डाउनलोड पी.डी.एफ. ई-बुक्स
C - Large And Small Number

विवरण :

कोई विवरण नहीं है |


सोर्स कोड :

#include <stdio.h>

int main ()
{
int num[5], i, j, max, min;

printf ("Please enter 5 numbers\n");
for (i = 0; i < 5; i++)
{
scanf ("%d", &num[i]);
}
max = num[0];
min = num[0];
for (i = 0; i < 5; i++)
{
if (num[i] < min)
{
min = num[i];
}
else if (num[i] > max)
{
max = num[i];
}
}
printf ("Small number = %d\n", min );
printf ("Large number = %d", max );

return 0;
}

आउटपुट :

Please enter 5 numbers
5
6
7
8
9
Small number = 5
Large number = 9