Which keyword is used for defining a structure ?
Structure
Struct
Str
Stru
Why structures are defined globally ?
You save many lines of code by not rewriting an identical structure definition in each function that uses it.
You will never change its definition.
It is required in C++.
All of the above.
What is the alterantive name of data elements in structures ?
Objects
Members
Datas
None of the mentioned
What is the advantage of structure over arrays ?
Group variables of similar type.
Have lot of memory space.
Group variables of different type
Easy to access
What will be used when terminating a structure ?
:
}
;
;;
Which of the following can be a definition for structure ?
Literal
User defined variable
Pre defined variable
User defined data type
Which of the following accesses a variable in structure *b ?
b->var;
b.var;
b-var;
b>var;
What will be the output of this program ?
# include
using namespace std;
int main ( )
{
struct ShoeType {
char style;
double price;
};
ShoeType shoe1,shoe2;
shoe1.style='Adidas';
shoe1.price=9.99;
cout<
shoe2=shoe1;
shoe2.price=shoe2.price/9;
cou<
return 0;
Adidas $9.99
Adidas $1.11
Adidas $9.11
Adidas $11.11
Which of the following is the correct syntax to access the member 'roll no' of a structure variable named 's1' ?
s1.roll no
roll no.s1
s1.roll no( )
roll no. s1( )
Which of the following can group data elements ?
Array
Array list
Class