What is the output of the following program? #include using namespace std; int main() int first = 16; int second = 8; if ((first / second == 2) || (second / first == 3)) second = 10; first = 20; else if ((first % second == 2 || second % first == 1)) second = 15; first = 5; else first = -10; second = -20; cout
18. a. What is the output of the program in Exercise 17, if first = 16 and second = 5?
17. What is the output of the following program? #include using namespace std; int main() int first = 16; int second = 8;
if ((first / second == 2) || (second / first == 3)) second = 10; first = 20; else if ((first % second == 2 || second % first == 1)) second = 15; first = 5; else first = -10; second = -20; cout

// The ouput for code
#include <iostream>
using namespace std;
int main(){
int first = 16;
int second = 8;
if ((first / second == 2) || (second / first == 3)) {
second = 10;
first = 20;
}
else if ((first % second == 2 || second % first == 1)) {
second = 15;
first = 5;
}
else{
first = -10;
second = -20;
}
cout << "First: "<<first<<" & Second: " <<second;
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images









