Question

Im doing an assignment that finds the smallest and largest value of a list of integers. I got that part but my professor also wants me to output it as i.e.I get the bottom two but do not know how to make the list with 5 values in each row.

The list of values
24 56 38 47 84
74 48 20 21 39
the smallest value: 20 <I got this part
the largest value: 84 <I got this part


Heres my program
#include<stdio.h>
#include<conio.h>
void main()
{
int n,big,sml,i,totalNumber;
printf("\n How many number you will enter : ");
scanf("%d",&totalNumber);
for (i=0;i<totalNumber;i++)
{
printf("\n Enter number %d : ",i+1);
scanf("%d",&n);
if(i==0)
{
big=sml=n;
}
if(big<n) big=n;
if(sml>n) sml=n;
}
printf("\nLargest Value : %d",big);
printf("\nSmallest Value : %d",sml);
getch();
}

Any help?
Last edited on
I don't understand your question... what does your prof want you to output?
Topic archived. No new replies allowed.