wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Consider the following program segment:
main ( )
{
int counter = 40;
for(; counter;)
counter.....;
printf("%d", counter);

}
What is the output?

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

The correct option is C 0

The following program segment:
main ( )
{
int counter = 40;
for(; counter;)
counter.....;
printf("%d", counter);

}

Output:-

0.

A program counter is a register in a computer processor that contains the address (location) of the instruction being executed at the current time. As each instruction gets fetched, the program counter increases its stored value by 1.


flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Factors and Multiples
QUANTITATIVE APTITUDE
Watch in App
Join BYJU'S Learning Program
CrossIcon