- 1
Who works break with loop in c++
please tell me the answar
7 Respostas
+ 4
It can exit the loop.
+ 4
it won't reach 10 as normal, it'll break at 2.
+ 2
for(int i=0;i<10;i++){
cout<<i<<endl;
if(i==2){
break;
}
}
output:
0
1
2
+ 1
you mean "how break work in loops?"
it ends the execution of loop.
+ 1
show me in one example please
+ 1
example above
+ 1
Thanks allot