Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

8. what will the following programs print on the screen? a) #include <i…

Question

  1. what will the following programs print on the screen? a) #include <iostream> using namespace std; int main() { int freeze = 32, boil = 212; freeze = 0; boil = 100; cout << freeze << endl << boil << endl; return 0; }

Explanation:

Step1: Analyze variable assignments

First, freeze is initially set to 32, but then reassigned to 0. boil is initially set to 212, then reassigned to 100.

Step2: Analyze output statement

The cout statement prints freeze (now 0), then a new line, then boil (now 100), then a new line.

Answer:

0
100