Ask Question
12 June, 10:04

Struct personalInfo { string name; int age; double height; double weight; }; struct commonInfo { string name; int age; }; personalInfo person1, person2; commonInfo person3, person4; Which of the following statements is valid in C++?

a. person2 = person4;

b. person1 = person3;

c. person2 = person3;

d. person2 = person1;

+2
Answers (1)
  1. 12 June, 12:54
    0
    The answer is "Option d".

    Explanation:

    In the given C+ + language structure code two structure "personalInfo and commonInfo" is defined, inside the personalInfo structure four variable "name, age, height, and weight" is defined. Then second, structure "commonInfo" is defined, which contain two variable that is "name and age" this variable datatype is same as the above structure. In the next line, both structures two object is created, in which only option d that is "person2 = person1" is correct because these object holds the same value and other options are not correct because they don't hold object values.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Struct personalInfo { string name; int age; double height; double weight; }; struct commonInfo { string name; int age; }; personalInfo ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers