Ask Question
22 February, 15:44

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;

+4
Answers (1)
  1. 22 February, 17:01
    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?
Get an answer to your question ✅ “Consider the following statements: struct rectangleData { double length; double width; double area; double perimeter; }; rectangleData ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers