#include<stdio.h> |
struct
book |
{ |
int no; |
char name[30]; |
float price; |
}; |
void
main() |
{ |
struct
book s[5]; |
int i; |
for(i=0;i<5;i++) |
{ |
printf("Enter Number,
Name and Price of Book:"); |
scanf("%d%s%f",&s[i].no,&s[i].name,&s[i].price); |
// & not used to store string value |
} |
printf("\n************************\n"); |
printf("\nNo. \tName \tPrice"); |
for(i=0;i<5;i++) |
{ |
printf("\n%d \t%s \tRs.%.2f",s[i].no,s[i].name,s[i].price); |
} |
} |
|