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

Answers were Sorted based on User's Feedback



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

Answer / apoorv

it will be give u garbage value....u can't be sure for d
value....
its depend on d complier which value he read recently...
and it will be a garbage....according to d programer...bcoz
he don,t knw which value has been recentyly read by d
compiler...!!

Is This Answer Correct ?    0 Yes 0 No

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

Answer / dipanjan m

it will print garbage value

Is This Answer Correct ?    0 Yes 0 No

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

Answer / wakil sheikh

output will be 0

Is This Answer Correct ?    0 Yes 0 No

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

Answer / shakti singh khinchi

It will print garbage value & gives warning on compilation
like "too few arguments for format".

Is This Answer Correct ?    0 Yes 0 No

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

Answer / sudha

it will simply print a garbage value..........

Is This Answer Correct ?    0 Yes 0 No

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

Answer / bheda govind

printf("%d") THAN

OUTPUT IS----0(ZIRO)

Is This Answer Correct ?    0 Yes 0 No

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

Answer / rahul raj

It will not compile..

Is This Answer Correct ?    0 Yes 0 No

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

Answer / snigdhadeb

printf("%d");
will gives the answer 0....

Is This Answer Correct ?    0 Yes 0 No

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

Answer / vaisakh.r

printf("%d") will printf some garbage value since there is no varible specified in it.so compiler check the argument stack check offset depending on the format specifier print whats on that location, since we can't sure about that value say it will print some garbage value

Is This Answer Correct ?    0 Yes 0 No

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

Answer / baban dongare

It will generate the garbage value..

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C++ General Interview Questions

Why is it difficult to store linked list in an array?

6 Answers   Infosys, Lucent,


How can you force instantiation of a template?

1 Answers   ABC, Amazon,


what kind of projects are suitable for c and c++

0 Answers  


What is the difference between the parameter to a template and the parameter to a function?

0 Answers  


Can I make ios apps with c++?

0 Answers  






Explain deep copy and a shallow copy?

0 Answers  


Write a function to find the nth item from the end of a linked list in a single pass.

0 Answers   Huawei,


What is the full form of stl in c++?

0 Answers  


Why are pointers not used in c++?

0 Answers  


When is a template better solution than a base class??

2 Answers   emc2,


5. Can inline functions have a recursion?

4 Answers  


class X { private: int a; protected: X(){cout<<"X constructor was called"<<endl;} ~X(){cout<<"X destructor was called"<<endl} }; Referring to the code above, which one of the following statements regarding "X" is TRUE? a) X is an abstract class. b) Only subclasses of X may create X objects. c) Instances of X cannot be created. d) X objects can only be created using the default copy constructor. e) Only friends can create instances of X objects.

2 Answers   Quark,


Categories