...

/

Solution Review: Find the Person with the Highest Salary

Solution Review: Find the Person with the Highest Salary

Let's see the detailed solution review of the challenge given in the previous lesson.

We'll cover the following...

Solution #

Run the code below and see the output!

Press + to interact
#include <iostream>
using namespace std;
int main() {
// Initialize variable salary1 and salary2
int salary1 = 56;
int salary2 = 89;
// if condition
if (salary1 > salary2) {
// if body
cout << "person1";
} else {
// else body
cout << "person2";
}
// exit
return 0;
}

Explanation

Line No. 7 ...