C Program To Find Largest Of Three Numbers In An Array

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

void main()
{
int arr[3],i,lar;
clrscr();
printf("Enter Any Three Numbers  : ");
for(i=0;i<3;++i)
{
scanf("%d",&arr[i]);
}

lar=arr[0];
for(i=1;i<3;++i)
{
if(arr[i]&gt;lar)
lar=arr[i];

}

printf("\n\nLargest of Three Is  :  %d",lar);

getch();

}
Share on Google Plus

About Akash Manhas

This is a short description in the author block about the author. You edit it by entering text in the "Biographical Info" field in the user admin panel.
    Blogger Comment
    Facebook Comment

0 comments:

Post a Comment