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
0
Answer:
ki ni smjh at a.....
....
..
Answered by
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
Science,
5 months ago
History,
5 months ago
English,
5 months ago
Hindi,
9 months ago
Political Science,
9 months ago
Social Sciences,
1 year ago
Math,
1 year ago
Math,
1 year ago