Write a program to input two number and find highest number.
In this program we input two number and check which number is highest. For this, we give a condition As:- If 1st number is highest then print 1st number else 2nd number is highest and print 2nd number.
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter 1st number=");
scanf("%d",&a);
printf("Enter 2nd number=");
scanf("%d",&b);
if(a>b)
printf("\n1st number is highest");
else
printf("\n2nd number is highest");
getch();
}
OUTPUT
Enter 1st number=9
Enter 2nd number =7
1st number is highest
Related Examples
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("Enter 1st number=");
scanf("%d",&a);
printf("Enter 2nd number=");
scanf("%d",&b);
if(a>b)
printf("\n1st number is highest");
else
printf("\n2nd number is highest");
getch();
}
OUTPUT
Enter 1st number=9
Enter 2nd number =7
1st number is highest
Related Examples
- Write a program to input a number and check number is positive or not.
- Write a program to input a number and check number is negative or not.
- Write a program to input a number and check number is positive,negative or nuteral.
Follow for recently updates ,Share and Comment.
Comments
Post a Comment