#include<stdio.h>
#include<conio.h>
struct Books {
char title[50];
char author[50];
char subject[100];
int book_id;
};
int main() {
int i;
struct Books Bookarray[5];
printf("\n Enter Books information \n");
for(i=0; i < 5 ;i++) {
printf("Book Title: ");
scanf("%s",Bookarray[i].title);
printf("Book author: ");
scanf("%s",Bookarray[i].author);
printf("Book subject: ");
scanf("%s",Bookarray[i].subject);
printf("Book book_id: ");
scanf("%d",&Bookarray[i].book_id);
printf(".........Next Book........... \n");
}
printf("\n Books information \n");
for(i=0; i < 5 ;i++) {
printf( "Book title : %s\n", Bookarray[i].title);
printf( "Book author : %s\n", Bookarray[i].author);
printf( "Book subject : %s\n", Bookarray[i].subject);
printf( "Book book_id : %d\n", Bookarray[i].book_id);
}
return 0;
}
Enter Books information
Book Title: C
Book author: RAMBO
Book subject: PROGRAMMING
Book book_id: 1
.........Next Book...........
Book Title: DATABASE
Book author: RAMBO
Book subject: DATA
Book book_id: 2
.........Next Book...........
Book Title: JAVA
Book author: RAMBO
Book subject: PROGRAMMING
Book book_id: 3
.........Next Book...........
Book Title: SQL
Book author: RAMBO
Book subject: DATABASE
Book book_id: 4
.........Next Book...........
Book Title: PHP
Book author: RABMBO
Book subject: PROGRAMMING
Book book_id: 5
.........Next Book...........
Books information
Book title : C
Book author : RAMBO
Book subject : PROGRAMMING
Book book_id : 1
Book title : DATABASE
Book author : RAMBO
Book subject : DATA
Book book_id : 2
Book title : JAVA
Book author : RAMBO
Book subject : PROGRAMMING
Book book_id : 3
Book title : SQL
Book author : RAMBO
Book subject : DATABASE
Book book_id : 4
Book title : PHP
Book author : RABMBO
Book su
First understand the algorithm carefully. Then study the program line-by-line and compare it with the output. Finally, review the explanation section to strengthen your logic and programming understanding.
Rewrite the program without looking at the code. Modify values, conditions or logic and run it again. This helps improve confidence and strengthens coding skills much faster.