0
What is the output of this code
Int main() { Int f=1,i=2; While(++i<4){ f*=i; } cout<<f<<endl; }
6 Answers
0
3
0
3
0
It is 3.
0
nice one
0
#include <iostream>
using namespace std;
int main()
{
int f=1,i=2;
while(i++<4){ // here i=2 then 3
f*=i; // here i=3 then 4
}
cout<<"f while i++ ="<<f<<endl;
/////////////////
int ff=1,ii=2;
while(++ii<4){ //here ii=3
ff*=ii; //here also ii=3
}
cout<<"ff while ++ii="<<ff<<endl;
return 0;
}