what is the for statement to ouuput the numbers 1 to 20 ,each on anew line;
Last edited on
Do you know how to use a for loop?
Do you know how to print numbers and new lines?
the output like this
1
2
3
4
to 20
i do not know how to print the numbers and new line in for loop
Last edited on
please help for solve this program :(
1 2 3 4
|
int main ()
{
for (int n20; n>0; n--) {
cout << n << ", ";
|
its ok;or not;
Last edited on
Why not just google "for loop in c++"? Then google "new line C++".
Last edited on
thxs
the solution :)
'
1 2 3 4
|
int i;
{
for(int=1; i<=20; i++){
cout << "i"<< endl;
|
Last edited on
Last edited on