+ 1
why it is not show any output when run this program #include<iostream> using namespace std; int main(){ for(;;){ int i=0; if(i==1){ cout<<i; break; } ++i; }
2 Antworten
+ 2
you have initialised i=0 and have used "I"=1 c++ is case sensitive
+ 1
'i' is initialised as 0.
in the for loop no condition or anything else is given.... that is why value of I is never decreased or increased....that is it cannot be equal to 1 so if statement is also false and it jumps to break hence nothing is output!