Consider the following code fragment:
n = 3
while n == 3
Print n
n = n - 1
A) what will be the output of above code?
B) what is the reason behind this output?
C) what change/ correction will you make to above code to make it print some output?
Answers
Answered by
1
Answer:
A) you have not mentioned anything therefore you will get syntax error during compilation
B)if we remove the Syntax error and other errors then the output will be be 3
c) see the explanation box
Explanation:
// considering you are using c languages
int n= 3;
while(n==3)
{
printf (n);
n= n-1 ;
}
Similar questions