Write a program to input 6 numbers. After each number is input, print the biggest of the numbers entered so far
Answers
Answered by
0
Answer:
Explanation:Hear is three you can write any of no.
Attachments:
Answered by
0
Below are the program written in c language for the above question.
Explanation:
#include <stdio.h>
int main()
{
int times=1;
int number,greator=0;
while(times<7)
{
scanf("%d",&number);
if(number>greator)
greator=number;
printf("%d \n",greator);
times++;
}
return 0;
}
Output:
- If the user input is 1,2,3,4,5,6 then the output is 1,2,3,4,5,6.
- If the user input is 1,3,1,4,5,6 then the output is 1,3,3,4,5,6.
Code Explanation:
- while loop executes 6 times and take 6 value.
- Firstly assume the first value as the greatest value and then print the greater value after done the comparison between greater value and the new value.
Learn More:
- Define C Program : https://brainly.in/question/3999878
Similar questions