Question: The CandyBar structure contains three members.The first member holds the brand name of a candy bar.The second member holds the weight (which may have a
The CandyBar structure contains three members.The first member holds the brand name of a candy bar.The second member holds the weight (which may have a fractional part) of the candy bar, and the third member holds the number of calories (an integer value) in the candy bar.Write a program that declares such a structure and creates a CandyBar variable called snack, initializing its members to "Mocha Munch", 2.3, and 350, respectively.The initialization should be part of the declaration for snack. Finally, the program should display the contents of the snack variable.
Step by Step Solution
3.48 Rating (161 Votes )
There are 3 Steps involved in it
ANSWER struct CandyBar char brandName20 double weight int calories CandyBar snac... View full answer
Get step-by-step solutions from verified subject matter experts
