What is the output of printf("%d")?




Answers were Sorted based on User's Feedback



What is the output of printf("%d")?..

Answer / kesavan

It will print the garbage value.

Is This Answer Correct ?    81 Yes 28 No

What is the output of printf("%d")?..

Answer / guest

it is used to print one integer data type value.

Is This Answer Correct ?    87 Yes 46 No

What is the output of printf("%d")?..

Answer / cooooooool bipul

Hey people

It will not give any syntax error more specifically.. it
will not give any type of error..

The output depends on the compiler u r using...
if it is GCC of linux then O/p== garbage value
there are compilers which will give the last integer value
assigned..
example...
i=30;
printf("%d");

will give ouput 30... but for Gcc it will be garbage value.

Is This Answer Correct ?    43 Yes 8 No




What is the output of printf("%d")?..

Answer / vanitha

garbage value

Is This Answer Correct ?    26 Yes 11 No

What is the output of printf("%d")?..

Answer / anand

it will print some value currently on top of the stack

Is This Answer Correct ?    20 Yes 7 No

What is the output of printf("%d")?..

Answer / mohanraj

It will print a garbage value.

Is This Answer Correct ?    25 Yes 13 No

What is the output of printf("%d")?..

Answer / sid

it will give output "0"

Is This Answer Correct ?    48 Yes 42 No

What is the output of printf("%d")?..

Answer / sanjiv

It will give a garbage value. It is tested.

Is This Answer Correct ?    15 Yes 9 No

What is the output of printf("%d")?..

Answer / narendra

it will print 0

Is This Answer Correct ?    4 Yes 0 No

What is the output of printf("%d")?..

Answer / anzarudeen

garbage value

Is This Answer Correct ?    4 Yes 1 No

Post New Answer



More C++ General Interview Questions

Write a C++ program which will compute the volume of a sphere or a cylinder after prompting the user to type the first character for the shape name.

0 Answers   An-Najah National University,


You're given an array containing both positive and negative integers and required to find the sub-array with the largest sum (O(N) a la KBL). Write a routine in C for the above.

4 Answers  


What happens if an exception is throws from an object's constructor and from object's destructor?

3 Answers   TCS,


What is design pattern?

2 Answers   Samsung,


How the compilers arranges the various sections in the executable image?

1 Answers  






How do you know that your class needs a virtual destructor?

5 Answers   Lucent,


When a function is made inline. Write the situation where inline functions may not work.

2 Answers  


Ask to write virtual base class code?

0 Answers   Satyam,


what is the size of this class class size { public: char data1; double d; int data2; char data3; double data4; short data5; }; please explain the padding for these double variables.

9 Answers  


Evaluate: int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; } for fn(7); a) 10 b) 11 c) 1

4 Answers   Quark,


Do we have private destructors?

12 Answers   TCS, Symphony,


sizeof- is it functioning statically or dynamically?

2 Answers  






Categories