Answer to Question #209391 in C++ for adnan

Question #209391

1.     Write a program to read three integer numbers then find and print the largest one

among these numbers.


1
Expert's answer
2021-06-22T02:37:47-0400
#include<iostream>
using namespace std;
int main(){
	int first, second, third;
	cout<<"Enter the first the integer number"<<endl;
	cin>>first;
	cout<<"Enter the second the integer number"<<endl;
	cin>>second;
	cout<<"Enter the third the integer number"<<endl;
	cin>>third;
	int max;
	max = first;
	if(second>first && second > third ){
		max = second;
	}
	else if(third > first && third > second){
		max = third;
	}
  cout<<"The maximum integer number is:\t"<<max<<endl;
	
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS