#include<iostream>
using namespace std;
// finds the largest of 3 numbers
void largestNum(int a, int b, int c) {
if(a > b && a > c) {
cout << a << " : A is greater than B and C";
} else if(b > a && b > c) {
cout << b << " : B is greater than A and C";
} else {
cout << c << " : C is greater than B and A";
}
}
int main(){
largestNum(12, 8, 6);
return 0;
}
OUTPUT-
12 : A is greater than B and C
No comments:
Post a Comment