You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
541 B
C

/*Structure as argument*/
/*Write a program to read information of a book and display the information.*/
#include<stdio.h>
#include<string.h>
struct book
{
int bno;
char name[40];
};
void display(struct book);
void main()
{
struct book b;
printf("\nEnter book no: ");
scanf("%d",&b.bno);
printf("Enter book name: ");
scanf("%s",b.name);
display(b);
}
void display(struct book b)
{
printf("\n details are: ");
printf("Book number=%d",b.bno);
printf("Book name=%s",b.name);
}