60 696
Assignments Done
97,8%
Successfully Done
In April 2018

Answer to Question #16431 in C++ for arif hussain

Question #16431
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
Expert's answer
#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!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions