Write a c program to find the largest of two numbers or program to find greatest of two numbers in c.
Write a c program to find the largest of two numbers or program to find greatest of two numbers in c.
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,large;
clrscr();
printf("Enter two numbers\n");
scanf("%d%d",&a,&b);
large=a;
if(b>large)
large=b;
printf("Largest number is %d",large);
getch();
}
Output:
Enter two numbers
5
6
Largest number is 6
No comments: