Ask Question
18 May, 15:55

Consider the following statements: struct rectangleData { double length; double width; double area; double perimeter; }; rectangleData bigRect; Which of the following statements is valid in C++?

a. cout << bigRect;

b. cin >> bigRect. length >> width;

c. cout << length;

d. cout << bigRect. length;

+1
Answers (1)
  1. 18 May, 17:52
    0
    The answer to this question is the option "d".

    Explanation:

    In the given C+ + programming language code. The structure is a collection of heterogeneous elements. It is similar to class because both (class and structure) holds a collection of different data types. In the structure, the struct keyword is used to defines a structure. The syntax of the structure can be given as:

    Syntax:

    struct structure-name

    {

    //different types of variables.

    char name[50];

    int age;

    float salary;

    }[create a structure variable];

    In this question the valid statement for c+ + code is

    "cout << bigRect. length; ". In this code we create a structure variable and call the variable length.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Consider the following statements: struct rectangleData { double length; double width; double area; double perimeter; }; rectangleData ...” 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