Subscribe For Free Updates!

We'll not spam mate! We promise.

Sunday, 26 August 2012

C++ code to Displaying Smallest integer from three inputs



//Displaying Smallest integer
//Programmer name: Sohail ahmed
//Date: 10-03-2010

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

int main()
{
clrscr();
float num_1, num_2, num_3;
cout<<"\n---Displaying Smallest value---\n\n";
cout<<"Enter 1st value: ";
cin>>num_1;
cout<<"\nEnter 2nd value: ";
cin>>num_2;
cout<<"\nEnter 3rd value: ";
cin>>num_3;

if(num_1<num_2 && num_3)
cout<<"\n1st value is Smallest!";
else if(num_2<num_3 && num_1)
cout<<"\n2nd value is smallest!";
else if(num_3<num_2, num_1)
cout<<"\n3rd value is smallest!";
else
cout<<"Invalid option";
getch();
return 0;
}

Socializer Widget By CodingLovers
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments:

Post a Comment