Computer Science, asked by chetnathumbar0, 11 months ago

What is the output of C Program?
void main({
int a=32;
do{
printf("%d", a);
a++
ifla >35)
break;
while(1);​

Answers

Answered by Anonymous
25

\bold{\huge{\red{\underline{\underline{\rm{ Given :}}}}}}

void main()

{

int a=32;

do{

printf("%d", a);

a++

if(a >35)

break;

while(1);

__________________________

\bold{\huge{\blue{\underline{\underline{\rm{ To\:Find :}}}}}}

The output of this program.

__________________________

\huge{\underline{\underline{\purple{♡Answer→}}}}

The output of this program is -

32 33 34

__________________________

\green{\bold{\underline{\underline{Step-by-step\:explanation:}}}}

In this program , do while loop us used. While(1) is an infinite loop which means that loop will run till there is no break condition or statement.

And there is a condition in this loop -

\boxed{\huge{\purple{if\: ( a > 35 )}}}

\boxed{\red{\huge{Break\: ();}}}

It means that if the value of a will become greater than 35 , loops bill be terminated.

In this program , given -

\boxed{\red{a = 32}}

Because it is a do while loops , it will be executed at least 1 time whether condition is true or false.

Loops will run and 32 will be printed.

And the value of a will be incremented by 1. The value of a will become 33. It checks that (33> 35 )

the condition is false so the loop will be continued.

33 will be printed and the value of a will become 34.

It will check again (34 > 35) the condition is false again and loop will be continued.

The value of a will become 35 , it will check again (35>35) now condition is true because 35 is not greater than 35 and loop will be terminated.

So the output will be -

32 33 34

__________________________

Mark as Brainliest !! ✨✨


Anonymous: :)
Similar questions