+ 1
What's wrong in this code? Please help
7 Answers
+ 5
should be: cin>>a>>b>>c>>d>>e;
The comma allows multiple expression to be evalulated mainly used here:
for (int i=0, j=5; i<6; i++,j--)
which counts i from 0 to 5 while j goes from 5 to 0.
+ 2
thanks sir
+ 2
I think this is corrected now
+ 1
sorry for previous inconvenience
+ 1
OK. I suspect the problem is here.
8: cin>>a,b,c,d,e;
First "cin >> a" is done.
Because the priority of ">>" is higher than ",".
Then b, c, d and e are not initialized so it doesn't show you the expected result.