Saturday, June 29, 2013

Write a program to find the greatest no in given array?

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

void main()
{
int no[100],i,n,high=0;
clrscr();
printf("\n enter the no of no ");
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%d",&no[i]);
if(high<no[i])
high=no[i];
}

printf("\n the %d  is greater",high);
getch();
}

Output:
image




Like the Post? Do share with your Friends.

No comments:

Post a Comment