Monday, May 24, 2010

C program to find the greatest and the least of the given numbers?

how to write this program ...else i wanna get the written program

C program to find the greatest and the least of the given numbers?
#include %26lt;stdio.h%26gt;


#include %26lt;conio.h%26gt;


void main()


{


int n, i, a, big = 0;


printf("How many total numbers...\n");


scanf("%d",%26amp;n);


for(i=1;i%26lt;=n;i++)


{


printf("\nEnter the number:");


scanf("%d",%26amp;a);


if (a%26gt;big)


big=a;


}


printf("The largest number is %d",big);


getch();


}





I hope this helps you.





Regards,


Praveen Kumar


No comments:

Post a Comment