find the largest of given two numbers

9. Write a Program to find the largest of given numbers?
#include
#include
void main()
{
int a,b;
printf("enter the numbers");
scanf(%d%d",&a,&b);
if(a>b)
printf("large %d ",a);
else
printf("small %d", a);
getch();
}


Algorithum
1.start
2.read a,b
3.if (a>b)
4.print large
5.else
6.print small
7.stop


Result
The program is sucessfully executed and desired output is obtained

Output
enter numbers
2 4
large 4

0 comments:

Post a Comment