CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

What is the output of the following 'C' program?
main()
{
extern, int a;
printf("\n%d",a)'
}
int a =20

A
0
No worries! We‘ve got your back. Try BYJU‘S free classes today!
B
20
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
Error
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
Garbage value
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
Open in App
Solution

The correct option is D Garbage value

The output of the following 'C' program
main()
{
extern, int a;
printf("\n%d",a)'
}
int a =20

Output:-

Garbage value

We have only declared the variable, and not initialized it, which means that the block of memory that has been allocated to the variable still contains some value that has been left over from previous programs and operations. That value is called a garbage value.



flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Profit or Loss Account
ACCOUNTANCY
Watch in App
Join BYJU'S Learning Program
CrossIcon