Find output of the below program:
#include<stdio.h>
void foo(int m)
{
int k=0;
while(m>0)
{
if(m%2—0)
{
k=k+4;
}
m=m-1;
if(m==k)
{
break;
}
}
printf("%d",k);
}
int main()
{
int x = 12;
foo(x);
return 0;
}
Answers
Answered by
0
Answer:
The final Output will be 8
Answered by
0
The output is,
8
- foo() function is with a parameter in it.
- It stores the passed in the variable 'm'.
- The is a while loop used inside the function.
- In which some operations are taking place.
- Those operations in result output the value of 'k' as 8.
Similar questions