Computer Science, asked by anudeepnarayanavanam, 1 year ago

Trace out and explain the output of the c-programme
#include
main()
{
int i,j;
if (i&&j++)
printf("%d..%d",i++,j);
printf("%d..%d",i,j);
}

Answers

Answered by deepranpara999
1
here i and j both will have the garbage value.so.it will print those values as the condition will become true.

anudeepnarayanavanam: I know output but i dont know how it comes
deepranpara999: what is the output?
anudeepnarayanavanam: 0..0
deepranpara999: Did you write the program in C Language?
anudeepnarayanavanam: Yes
anudeepnarayanavanam: Oh sorry i missed header file names
deepranpara999: Ok. As you are saying the result is 0 0. It is following this logic:
deepranpara999: Whenever the variable is declared, it will be assigned initial values like int 0 float 0.0 and so on. This can be the logic for assigning i and j the value 0
anudeepnarayanavanam: Yeah
anudeepnarayanavanam: Might be correct thanks
Similar questions