can a for loop have 2 integers, 2 conditions and 2 increments? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
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 Answers
+ 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