Write a program to input two number and find smallest number.

In this program we input two number and check which number is smallest. For this, we give a condition As:- If 1st number is smallest then print 1st number else 2nd number is smallest 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 smallest");
else
printf("\n2nd number is smallest");
getch();
}

OUTPUT 

Enter 1st number=7
Enter 2nd number =10

1st number is smallest

Related Examples 

  1. Write a program to input a number and check number is positive or not.
  2. Write a program to input a number and check number is negative or not. 
  3. Write a program to input a number and check number is positive,negative or nuteral.
  4. Write a program to input two number and find highest number. 




Follow for recently updates ,Share and Comment. 

Comments

Popular posts from this blog

Write a program to input age of any person and check he is eligible for voting or not.

Write a program to input two digit number and check number is palindrome or not.

Write a program to input speed of Royal Enfield and check it's running at economic speed or not.