Write A Program That Reads In Five Integers And Determines And Prints The Largest And The Smallest Integers In The Group?

2

2 Answers

Ashif Mohammed Profile
Ashif Mohammed answered
Read integers, a is largetst parint ekse b elsec elsed els e e
Anonymous Profile
Anonymous answered
#include<stdio.h>#include<conio.h>main(){   int a[5],I,max,min;      printf("\n enter five numbers:");      for(I=0;I<5;I++)        scanf("%d",&a[I]);      max=min=a[0];      for(I=0;I<5;I++)        { if(a[I]>max)            max=a[I];          }     for(I=0;I<5;I++)        { if(a[I]<min)        min=a[I];      }         printf("\n The largest number is %d and smallest number is %d",max,min);   getch();   }  

Answer Question

Anonymous