Ask Question

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. 24 December, 13:58
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers