Getting Started With C

We'll perform operations on individual members of the structure, such as displaying book details and updating the number of pages.

  • Examples :

    Program.c


  • Example Output:

    Enter book title: "The Catcher in the Rye"
                   Enter author name: J.D. Salinger
                   Enter publication year: 1951
                   Enter number of pages: 224
                   
                   Book Details:
                   Title: The Catcher in the Rye
                   Author: J.D. Salinger
                   Year: 1951
                   Pages: 224
                   
                   Enter updated number of pages: 240
                   
                   Book Details:
                   Title: The Catcher in the Rye
                   Author: J.D. Salinger
                   Year: 1951
                   Pages: 240
                   

    Resources :

    Test Your Knowledge
    Choose The

    With supporting text below as a natural lead-in to additional content.

    Q1. Suppose you have a structure named Book with a member pages. How would you increment the value of pages for a structure variable named myBook?

    Q2. If you have a structure with members price and quantity named Product, how would you calculate the total cost for a variable named item?