C
Programming and Technical
Programming
Output
Find the output.
main()
int i;
pf("%d",i);
1.0
2.NULL
3.GARBAGE VALUE
4.COMPILE ERROR
Read Solution (Total 24)
-
- garbage value
- 9 years agoHelpfull: Yes(4) No(0)
- 3
uninitialized values are assigned garbage values - 9 years agoHelpfull: Yes(2) No(0)
- Garbage Value.
Variables point to a location in the memory where some random value may be residing due to previous execution or due to some other program. Hence, uninitialized variables may print some garbage value. - 9 years agoHelpfull: Yes(0) No(0)
- printf is placed out of the scope of the main()
- 9 years agoHelpfull: Yes(0) No(0)
- 3. garbage value
- 9 years agoHelpfull: Yes(0) No(0)
- ans 3
sice i is nt initialized
- 9 years agoHelpfull: Yes(0) No(0)
- option 4 as pf will nt read by compiler
- 9 years agoHelpfull: Yes(0) No(0)
- garbage value
becoz unintialize value assigned garbage value. - 9 years agoHelpfull: Yes(0) No(0)
- 3 garbage value
- 9 years agoHelpfull: Yes(0) No(0)
- 3.garbage value because it doesnt initialised
- 9 years agoHelpfull: Yes(0) No(0)
- ans:3 i.e garbage value
- 9 years agoHelpfull: Yes(0) No(0)
- compile error
- 9 years agoHelpfull: Yes(0) No(0)
- GARBAGE VALUE
- 9 years agoHelpfull: Yes(0) No(0)
- garbage value
- 9 years agoHelpfull: Yes(0) No(0)
- compilation error. because we cannot write pf(). it should be printf().and also expected '}' at the end
- 9 years agoHelpfull: Yes(0) No(0)
- garbage value because variable i is not initialized
- 9 years agoHelpfull: Yes(0) No(0)
- 3. GARBAGE VALUE
- 9 years agoHelpfull: Yes(0) No(0)
- garbage value
- 9 years agoHelpfull: Yes(0) No(0)
- garbage value because in c default values are garbage values
- 9 years agoHelpfull: Yes(0) No(0)
- ans may be zero or any value
Accessing an unitialized variable is undefined behavior in both C and C++ so it can give any value 0 or any value.It is also possible that your program crashes: - 9 years agoHelpfull: Yes(0) No(0)
- option 4
compilation error
coz all the codes has been written outside the main as main does not contain opening braces - 9 years agoHelpfull: Yes(0) No(0)
- 3. GARBAGE VALUE
- 9 years agoHelpfull: Yes(0) No(0)
- its compile error because of declaration syntax error
- 9 years agoHelpfull: Yes(0) No(0)
- option 1
by default integer values taken as 0 - 9 years agoHelpfull: Yes(0) No(0)
C Other Question