Write in C ++ the while functionally equivalent to the following structure for: for (i = 1; i ≤ N; i ++) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Write in C ++ the while functionally equivalent to the following structure for: for (i = 1; i ≤ N; i ++)

Help

2nd Dec 2019, 8:34 PM
panik 007
panik 007 - avatar
5 Answers
0
int i=1; int N=5; while(i<=5) { cout<<i; //add more if you need like above line i++; } please go through your lesson ones..... https://www.sololearn.com/learn/CPlusPlus/1614/
3rd Dec 2019, 10:55 AM
Jayakrishna 🇮🇳
+ 1
Please, show us your code 😉
2nd Dec 2019, 8:55 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
I don't know how to do it I don't quite understand how to do it and I'm in the beginning
2nd Dec 2019, 8:57 PM
panik 007
panik 007 - avatar
0
at the beginning of the program, declare the variable " i " (counter) and assign it the value 1, then in the next line write the keyword "while". this was followed by the word in parentheses, write the execution condition of the cycle, which cycle will be repeated. on the next line, insert the opening curly brace, followed by the counter i give an increase of one. if necessary, add other necessary lines of code. at the end, close the braces. remember to end each line of code with a semicolon.
2nd Dec 2019, 9:18 PM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
0
Thx
3rd Dec 2019, 8:58 PM
panik 007
panik 007 - avatar