Pia tunatoa huduma zifuatazo.

Tunatengeneza blogu, tovuti(website), youtube chaneli n.k.. Mawasiliano:
simu:+255763670000, Barua pepe: khalfanm021@gmail.com

Saturday, September 15, 2018

Question 3:Write C++ Program to Find Largest Number among Three Numbers

Question 3:Write C++ Program to Find Largest Number among Three Numbers
Solution

#include<iostream>
using namespace std;
int main(){
float a,b,c;
cout<<"\nC++ PROGRAM TO CHECK THE GREATEST NUMBER\n\n";
cout<<"Enter the first number\n";
cin>>a;
cout<<"Enter the second number\n";
cin>>b;
cout<<"Enter the third number\n";
cin>>c;
if(a>&& a>c){
cout<<"The first number which is " <<a<< " is the largest than "<<b<<" and "<<c<<endl;
}else if(b>&& b>c){
cout<<"The second number which is " <<b<< " is the largest than "<<a<<" and "<<c<<endl;
}else{
cout<<"The last number which is " <<c<< " is the largest than "<<b<<" and "<<a<<endl;
}
return 0;
}



PLEASE LEAVE A COMMENT, OR ANY OTHER QUESTIONS INVOLVING ANY OF THE FOLLOWING LANGUAGES, C++, PHP, JAVASCRRIPT, HTML, CSS, MYSQL

No comments:

Post a Comment