-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path49.c
More file actions
34 lines (25 loc) · 708 Bytes
/
49.c
File metadata and controls
34 lines (25 loc) · 708 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
// Program to maintain a book store record with field (booknumber, bookname, author, price).
#include <stdio.h>
struct book {
int bookno;
char bookname[50];
char author[50];
float price;
};
int main() {
struct book b;
printf("Enter book number: ");
scanf("%d", &b.bookno);
printf("Enter book name: ");
scanf("%s", b.bookname);
printf("Enter author name: ");
scanf("%s", b.author);
printf("Enter price: ");
scanf("%f", &b.price);
printf("\n--- Book Details ---\n");
printf("Book Number: %d\n", b.bookno);
printf("Book Name: %s\n", b.bookname);
printf("Author: %s\n", b.author);
printf("Price: %.2f\n", b.price);
return 0;
}