Computer Science, asked by leelavatidevadiga456, 11 months ago

What will be the output after execution of the program?
#include
int main()
{
int i,a[4]={3,1,2,4},result;
result=a[0];
for(i=1;i<4;i++)
{
if(result>a[i])
continue;
result=a[i];
}
printf("%d",result);
return0;
}
Hint:-
Only numeric answer

Answers

Answered by payalsoni034
0

Answer:

ki ni smjh at a.....

....

..

Answered by sumanggmu
1

Answer: 4

Explanation:

result=3

iteration 1: is 3> a[1] i.e is 3>1 YES,so continue to iteration 2 without moving to the next part of the loop

iteration 2: is 3> a[2] i.e is 3>2 YES,so continue to iteration 3 without moving to the next part of the loop

iteration 3: is 3> a[3] i.e is 3>4 NO,so don't execute the next line after if statemen, move to the next line i.e result=a[i] i.e result=a[3] i.e result=4

So answer is 4

Similar questions