← Back to Structs
Question 241
Book Struct: Title and Page Count
Book Struct: Title and Page Count
Define a struct type named Book with a text field title (a char array) and an integer field pages. Create a Book with the title "C Basics" and 120 pages, then print it exactly as: C Basics has 120 pages followed by a newline. Set the string field when you declare the variable.
Expected Output:
C Basics has 120 pages= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
Structs
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (p, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.