simple program but cant understand the output.
Hi guys i am new to c programming . can anyone tell me why the output value of i in the last line is 2. i am confused.
program:\-
#include \
int main\(\){
int i;
i = printf\("Hello\\n"\);
printf\("%d\\n",i\);
i = printf\("%d",printf\("Hello world linux\\n"\)\);
printf\("\\t%d\\n",i\);
return 0;
}
output:\-
Hello
6
Hello world linux
18 2
Thankyou
https://redd.it/8oq6ix
@r_cpp
Hi guys i am new to c programming . can anyone tell me why the output value of i in the last line is 2. i am confused.
program:\-
#include \
int main\(\){
int i;
i = printf\("Hello\\n"\);
printf\("%d\\n",i\);
i = printf\("%d",printf\("Hello world linux\\n"\)\);
printf\("\\t%d\\n",i\);
return 0;
}
output:\-
Hello
6
Hello world linux
18 2
Thankyou
https://redd.it/8oq6ix
@r_cpp