Write a program to find the smallest number out of the 2 numbers inputted by the user.

 

#include<iostream.h>
#include<conio.h>

void main()
{
clrscr();
int a,b;

cout<<"Enter value of a:";
cin>>a;
cout<<"Enter value of b:";
cin>>b;

if(a<b)
cout<<"a is smaller than b";
else
cout<<"b is smaller than a";

getch();
}

< Back