+ 4
what is the output? for (int a = 0; a < 10; a++) { cout << a << endl; }
c++ basic
9 Réponses
+ 8
The output will be like this :-
0
1
2
3
4
5
6
7
8
9
because it loops from 0 until the value is smaller than 10.But 10 is equal to ten. Therefore, It stops looping around.Endl makes a new line after every number.
+ 4
o to 9 loop
+ 4
@pelham it will not print from 0-10 it will print 0-9 because when it will be equal to 10 it will not satisfy the situation. from printing 0-10 you should add <= this sign in place of < . Got it.
+ 1
same as akash
+ 1
same as akash
0
О 9
0
I'm new to c++ but I do know Java and so it would print 0-9
0
2
0
0-10