0

how can we do 2 things using a loop

suppose i have to make a program to add 2 number for first 5 times and then next 5 times i have to subtract 2 numbers. how can i do this using loop?

7th Aug 2017, 5:15 PM
shobhit
shobhit - avatar
1 Réponse
+ 6
for (int k = 0; k < 10; ++k){ if (k <= 4) // ADD else // SUBTRACT }
7th Aug 2017, 5:29 PM
Babak
Babak - avatar