0% found this document useful (0 votes)
37 views1 page

1 Book

Uploaded by

Ayush Mohanty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views1 page

1 Book

Uploaded by

Ayush Mohanty
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

#include<stdio.

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");
}
}

You might also like