Write a program to demonstrate the use of a struct for managing book data.
MediumProblem Statement
Write a program to demonstrate the use of a struct for managing book data.
Sample Input
Define a struct Book with title, author, and price.
Sample Output
Title: 1984 Author: George Orwell Price: $15.99
Limits
Time: 2s · Memory: 256 MB
Code Editor
00:00
#include <iostream>
#include <string>
struct Book {
std::string title;
std::string author;
float price;
};
int main() {
Book book1;
// Logic to manage book data
return 0;
}
Input
Define a struct Book with title, author, and price.
Expected Output
Title: 1984 Author: George Orwell Price: $15.99