Write algorithm to input N numbers and print the largest number from it and draw flowchart
Answers
Answered by
5
Algorithm and flowchart are given below.
Explanation:
- An algorithm is a step-by-step method or instruction to solve a problem. The basis of writing a program is created by them.
Steps for algorithm to input N numbers and print largest number:
- Start
- Declare i, a[10],n,max
- Read n (Number of numbers)
- Read the numbers and store them in a array
for(i=0;i<n;i++)
scanf("%d",&a[i]);
5. max=a[0];
6. for(i=0;i<n;i++)
if(max<a[i])
max=a[i];
7. Print max
8. Stop
Refer the attached image for the flowchart.
Attachments:
Similar questions