int a=2,b=3,c=4;
printf("a=%d,b=%d\n",a,b,c);
what is the o/p?
Answer Posted / vignesh1988i
this reply for Mr. Sanjay..........
one thing to understand , unless or until we initilize or get i/p from the user to any variables their GARBAGE CONTENT will be there inside the variable .... so like this u are printing the value of variable a wit out initilizing or feeding the i/p from the user.... SO FIRST PRINTF will show only garbage values , so only ur first output is -12.........
in scanf you have missed to specify the location of a where the value must get stored.... so , in the o/p screen u can type the value but it wont get stored in the memory location named as 'a'.... because you didn't specify the memory location of 'a' to the compiler.....
because of this in the next printf statement , it will print some other garbage values... remember that garbage values are subjected to change at instances....
next line you are tyrying to print the address of variable a... know one thing that the addresses are only unsigned ones... but you have given a format specification as %d which refers to a ordinary int or short integer which ranges from -32767 to 32768... so if any value goes beyond 32768 it will take the corresponding negative value.................
the other are commented , so i dont want to comment abt it..
hope you would have understood sir....
thank u
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
which is an algorithm for sorting in a growing Lexicographic order
How can I recover the file name given an open stream or file descriptor?
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
Explain what is page thrashing?
What is the purpose of the preprocessor directive error?
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
hi friends how r u as soon in satyam my interview is start but i m very confusued ta wat i do plz help me frndz wat can i do plz tell me some question and answers related with "C" which r asked in the interview .
Can we use any name in place of argv and argc as command line arguments?
what do you mean by inline function in C?
What is LINKED LIST? How can you access the last element in a linked list?
Why is structure important for a child?
How can you find out how much memory is available?
What is an lvalue?
Which type of language is c?
Can we declare variables anywhere in c?