see

A

WAP to accept ‘n’ numbers as input and find the largest number of them using while loop


WAP to accept ‘n’ numbers as input and find the largest number of them using while loop

#include<stdio.h>
#include<conio.h>
void main()
{
 int a[5],s=0;
 int i;
 clrscr();
 for(i=0;i<5;i++)
 {scanf("%d",&a[i]);
 }
 i=0;
 while(i<5)
 {
  if(a[i]>s)
   s=a[i];
  i++;
 }
 printf("%d",s);
 getch();
}

Copyright © 2013. BloggerSpice.com - All Rights Reserved
Customized by: MohammadFazle Rabbi | Powered by: BS
Designed by: Tilabs