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
What is the use of f in c?
What is const volatile variable in c?
What is the role of && operator in a program code?
can anyone please tell about the nested interrupts?
Do pointers take up memory?
What is restrict keyword in c?
differentiate built-in functions and user – defined functions.
What is the difference between int main and void main?
about c language
Write a C++ program to generate 10 integer numbers between - 1000 and 1000, then store the summation of the odd positive numbers in variable call it sum_pos, then find the maximum digit in this variable regardless of its digits length.
What is the best organizational structure?
What is zero based addressing?
Differentiate between static and dynamic modeling.
How to write c functions that modify head pointer of a linked list?
Dont ansi function prototypes render lint obsolete?