Ask Question

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

Answers (1)
  1. 26 January, 01:50
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers