Sunday, September 18, 2011

WAP to find the largest of 10 numbers using for loop


/*
  Name: WAP to find the largest of 10 numbers using for loop 
  Author: Parveen Malik
  Date: 18/09/11 02:58 
*/


#include<stdio.h>
#include<conio.h>


int main(void)
{
    int a[15],max,i;
    printf("Enter any ten numbers \n");
    for(i=0;i<10;i++)
    {
                     scanf("%d",&a[i]);
                     if(i==0)
                      max=a[i];
                     
    if( a[i]>max)
    max=a[i];
}
printf("\nMaximum : %d",max);


getch();
return 0;
}


OUTPUT : 



0 comments:

Post a Comment