Ask Question
3 May, 15:21

Which of the following statements outputs the value of the gpa member of element 1 of the student array?

A.

cout << student1. gpa;

B.

cout << firstStudent. gpa;

C.

cout << student[1]. gpa;

D.

cout
+1

Answers (1)
  1. 3 May, 16:26
    0
    The correct answer for the given question is option (c) i. e

    cout << student[1]. gpa;

    Explanation:

    In the given question gpa is the member of array student which index or element value is 1.

    To access that member of array student we using the following syntax i. e

    arrayname[index no or element no]. variable name

    In the option (A) the square bracket is not mention that's why it is incorrect option.

    In the option (B) the array name is wrong i. e firstStudent that's why it is incorrect option.

    In the option (D) the square bracket is not mention as well as - > operator is used to access member of array that's why it is incorrect option.

    So student[1]. gpa; is the correct statement which option is A cout << student1. gpa;.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Which of the following statements outputs the value of the gpa member of element 1 of the student array? A. cout ...” 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