1 Book
1 Book
h>
#include<string.h>
#define SIZE 20
struct book
{
char name[25];
char a[10];
int p;
};
void output(struct book v[],int n);
main()
{
struct book b[SIZE];
int num=1,i;
printf("\n");
for(i=0;i<num;i++)
{
printf("\t=:Book %d Detail:=\n",i+1);
printf("\nEnter name of the Book:\n");
scanf("%s",b[i].name);
printf("Enter the name of Author of the Book:\n");
scanf("%s",b[i].a);
printf("Enter the Price of Book:\n");
scanf("%d",&b[i].p);
}
output(b,num);
}
void output(struct book v[],int n)
{
int i,t=1;
for(i=0;i<n;i++,t++)
{
printf("\n");
printf("Book No.%d\n",t);
printf("\t\tNAME OF BOOK %d is = %s\n",t,v[i].name);
printf("\t\tAUTHOR OF BOOK %d is = %s\n",t,v[i].a);
printf("\t\tPRICE OF BOOK %d is = %d\n",t,v[i].p);
printf("\n");
}
}