Answer to Question #16431 in C++ for arif hussain
Q#2 Write a program to pass two numbers as arguments to the function body, compare the numbers and print the greater number on the screen
1
2012-10-17T09:38:32-0400
#include<iostream>
using namespace std;
int a, b;
int comparison(int a, int b){
if (a<b) return b;
& else return a;
}
void main(){
cout<<"enter the 1st number: ";
cin>>a;
cout<<"enter the 2nd number: ";
cin>>b;
cout<<"the greater number is "<<comparison(a,b)<<"\n";
system("PAUSE");
}
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!
Learn more about our help with Assignments:
C++
Comments
Leave a comment