forked from jrabhishek/opps
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path1.cpp
More file actions
40 lines (32 loc) · 716 Bytes
/
Copy path1.cpp
File metadata and controls
40 lines (32 loc) · 716 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <iostream>
using namespace std;
struct Book
{
char author[100];
char title[100];
int price;
};
int main()
{
struct Book books[2];
int i;
char c[10];
for ( i = 0; i < 2; ++i)
{
cout << "enter author title and price of book\n";
cin.getline(books[i].author,100);
//cin>>books[i].title;
cin.getline(books[i].title,100);
cin >> books[i].price ;
//cin.getline(c,10);
cin>>c;
}
cout << "======================================================\n";
cout <<"author\t title\t price\t\n";
cout << "=====================================================\n";
for ( i = 0; i < 2; ++i)
{
cout << books[i].author <<"\t"<< books[i].title <<"\t"<< books[i].price<<"\n" ;
}
return 0;
}