Consider the following statements: struct rectangleData { double length; double width; double area; double perimeter; }; rectang
leData 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;
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.