Ask Question
14 January, 23:23

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
+5

Answers (1)
  1. 15 January, 00:09
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers