Consider the declaration of the struct houseType given in this chapter. Suppose firstHouse and secondHouse are variables of houseType. Write C11 statement(s) to compare the style and price of firstHouse and secondHouse. Output true if the corresponding values are the same; false otherwise. (2, 3)

Respuesta :

Answer:

See Explanation

Explanation:

The question is incomplete as there is no link pointing to the houseType struct of chapter 1.

So, I've answered the question from scratch

See attachment for explanation where I used comments to explain each line.

The program is as follows:

#include <iostream>

using namespace std;  

struct houseType{

   int firstHouse, secondHouse;

};

int main() {

   houseType hT;      

   cout << "Enter the price of both house: ";

   cin>> hT.firstHouse;

   cin>> hT.secondHouse;

   if(hT.firstHouse == hT.secondHouse){ cout<<"true";    }

   else{ cout<<"false";    }  

   return 0;

}

Ver imagen MrRoyal