Question
Easy
In C program, what is the right syntax to access value of structure variable book {price, page}?
1
printf(""%d%d"", book.price, book.page);
2
printf(""%d%d"", price.book, page.book);
3
printf(""%d%d"", price::book, page ::book);
4
printf(""%d%d"", price->book, page->book);
Question Details
Time to Solve: 12
Exam: HTET
Level/Paper: Level 3
Chapter: Data Structures (Through C++)
Topic: Arrays & Structure
Correct Answer
Option A
Explanation
The correct option is (1): printf(""%d%d"", book.price, book.page); The fundamental principle for accessing members of a structure in C programming is the use of the dot operator (.). When you declare a structure variable, such as book in this scenario, the dot operator acts as the member selection operator, allowing you to directly reach the individual elements (fields) stored within that variable. The required syntax is always the **structure variable…Read More
Similar Questions from HTET Exam - Level 3 - Year 2020
Question 1
Easy
Source :
HTET 2020
A Database Management System (DBMS) is:
Chapter :
Database Management System (DBMS) & SQL
Topic :
Database Concepts
Question 2
Easy
Source :
HTET 2020
OCR stands for:
Chapter :
Computer System & Hardware Fundamentals
Topic :
Computer System
Question 3
Easy
Source :
HTET 2020
Which of the following protocol used to transmit information on the World Wide Web ?
Chapter :
Computer Networks & Internet
Topic :
Internet Protocols
Question 4
Easy
Source :
HTET 2020
Which of the following is the most commonly used data structure for implementing Dijkstra's Algorithm?
Chapter :
Data Structures (Through C++)
Topic :
Data Structure Concepts