What is the output of the following program? #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 << " " << second << endl;return 0;}
What is the output of the following program? #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 << " " << second << endl;return 0;}
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
What is the output of the following program?
#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 << " " << second << endl;
return 0;
}
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images