Can you explain this program?

0 Saikrish Nsk · February 12, 2015
int main()

{
 int a,b,c,d;
c=a,b;
d=c,a,b;
printf(" %d %d", c,d);
return 0;
}


The output is 54 54

Post a Reply

Replies

Oldest  Newest  Rating
0 c student · February 12, 2015
a = uninitialised value
c = a = uninitialised value
d = c = unitialised value
uninitialised value = 54
0 Lazar Bulic · February 12, 2015
U are just declaring variables but you aren't providing the value to the variable. In that case the value of the variable will be anything that is left in the memory to which that variable was assigned. In this case 54. When i run the program i will probably get something else :)  
0 Saikrish Nsk · February 12, 2015
ohhh!!! yah, thank you guys
0 Mr. Computer · February 12, 2015
uninitialized value = 54 
  • 1

C

107,082 followers
About

One of the most popular languages of all time.

Links
Moderators
Bucky Roberts Administrator