Chapter 12: Arrays and Structures - Online Test

Q1. Which of the following is the collection of variables of the same type that an referenced by a common name ?
Answer : Option C
Explaination / Solution:
No Explaination.


Q2. Array subscripts is always starts with which number ?
Answer : Option B
Explaination / Solution:
No Explaination.


Q3. int age[]={6,90,20,18,2}; How many elements are there in this array?
Answer : Option B
Explaination / Solution:
No Explaination.


Q4. cin>>n[3]; To which element does this statement accepts the value?
Answer : Option B
Explaination / Solution:
No Explaination.


Q5. By default, the string and with which character?
Answer : Option A
Explaination / Solution:
No Explaination.


Q6. The data elements in the structure are also known as
Answer : Option B
Explaination / Solution:
No Explaination.


Q7. Structure definition is terminated by
Answer : Option C
Explaination / Solution:
No Explaination.


Q8. What will happen when the structure is declared?
Answer : Option A
Explaination / Solution:
No Explaination.


Q9.

What is the output of this program?

#include <iostream>

#include <string.h>

using namespace std;

int main()

{

 struct student

 {

 int n;

 char name[10];

 };

 student s;

 s.n = 123;

 strcpy(s.name, "Balu");

 cout<<s.n;

 cout<< s.name <<endl;

return 0; }

Answer : Option A
Explaination / Solution:
No Explaination.


Q10.

A structure declaration is given below.

struct Time

{

int hours;

int minutes;

int seconds;

}t;

Using above declaration which of the following refers to seconds.

Answer : Option D
Explaination / Solution:
No Explaination.