0
Why this code prints "Hello" 4 times ?
#include <iostream> using namespace std; int main() { int i; for(i==1;i<=3;i++) { cout<<"Hello"<<endl; } return 0; } /* I know how to print hello 3 times. But I just want to know why the above one prints "Hello" 4 times ??? */
2 Respuestas
+ 3
because of i==1
so it takes i=0 by default
+ 1
Ratnapal Shende Thanks for telling 🙏