Search & Find out

Thursday, November 26, 2009

To Find Greatest Number

 To find greatest number among 'm' numbers


#include "stdio.h"
#include "conio.h"
 

void main ()
{
    int n[10],i,R,m;
    clrscr();

    printf("Enter the number of no.s do u wish to give to find greatest no. \n");
    scanf("%d",&m);

    for (i=0;i
    {
        printf ("Enter a number: ");
        scanf ("%d",&n[i]);
    }
    for (R=n[0],i=0;i
    {
        if (n[i]>R)
        R=n[i];
    }
    printf ("The greatest number is = %d",R);
getch ();
}



Download the executable (.exe)  file for this program..
download

0 comments:

Post a Comment

 

My Blog List

Term of Use