+ 6
What is the output of following code and explain.
#include<string.h> char str[]="love"; int i; i=strlen(str); cout<<i%3;
4 Respostas
+ 8
yeah, it was auto corrected,btw I recorrected it! @highman
+ 7
string length is 4
4is stored in i,
4%3 is 1
+ 3
I would say that your code is wrong.Probably you wanted to write strlen insted of stolen and I=stolen(str) should be i=strlen(str).If yes,I would expect the result 1.
+ 1
1