204,942 views
44 votes
44 votes
Code Example 9-1 struct Product { string name; double price; int quantity; }; (Refer to Code Example 9-1.) Given a Product object named product, which of the following statements would you use to display the value of the name data member on the console? a. cout << product::name; b. cout << product.name; c. cout << product("name"); d. cout << product[0];

User FeanDoe
by
2.9k points

1 Answer

18 votes
18 votes

Answer:

a. cout << Product ::name;

Step-by-step explanation:

Computer software use different languages which helps user to initiate command. When a user initiates command the results are displayed according to input command. If product name is required as output then insert command should be product::name; this will display names of different products present in the system.

User Edward An
by
2.9k points