google-site-verification: googlef8aa845b858144d3.html COMPUTER SCIENCE NOTES: Largest: (Example 2) C Program to Find the Largest Number Among Three Nu...

Friday, March 3, 2017

Largest: (Example 2) C Program to Find the Largest Number Among Three Nu...

/*program to find largest number from three given numbers */
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,larger;
clrscr();
printf("Enter three numbers :\n");
scanf("%d %d %d",&a,&b,&c);
if(a>b)
{
if(a>c)
larger=a;
else
larger=c;
}
else
{
if(b>c)
larger=b;
else
larger=c;
}
printf("Larger number is %d ",larger);
getch();
}





No comments:

Post a Comment