#include <iostream>
using namespace std;
struct book
{
char title[50];
char author[50];
int roll;
int publication;
float marks;
} s[5];
int Input(){
cout << "Enter information of books: " << endl;
for(int i = 0; i < 5; ++i)
{
s[i].roll = i+1;
cout << "For book" << s[i].roll << "," << endl;
cout << "Enter title: ";
cin >> s[i].title;
cout << "Enter Book Author:";
cin >> s[i].author;
cout << "Enter Publication Year:";
cin >> s[i].publication;
cout << endl;
}}
int display(){
cout << "The following information has been received…\n";
for(int i = 0; i < 5; ++i){
s[i].roll = i+1;
cout << "\nBook Title:" << s[i].title;
cout << ", Book Author:" <<s[i].author;
cout << ", Year Published:" << s[i].publication << "\n";
}}
int main()
{
Input();
display();
}
Comments
Leave a comment