0

can a for loop have 2 integers, 2 conditions and 2 increments?

E.g. for ( int x= 2,int y=3;x>a,y>b;x++,y++){}

14th Jul 2016, 6:52 AM
OMKAR
OMKAR - avatar
4 Réponses
+ 4
yes i think so a loop can have multiple assignments,inc or dec but conditions shd be merged using && or ||…
14th Jul 2016, 7:11 AM
Ruchir Gupta
0
Ok thanx I will try it out
14th Jul 2016, 7:13 AM
OMKAR
OMKAR - avatar
0
yes , multiple initialization,condition & increments can be used but separated by comma (,)
14th Jul 2016, 1:07 PM
Vittu singh
Vittu singh - avatar
0
thx
14th Jul 2016, 1:08 PM
OMKAR
OMKAR - avatar