well arranged,correct and stylish program lies here only!! #include struct book { char name[20]; int pages; float price; }b[100];
void main() { int n,i; printf("\n\nenter the number of books\n"); scanf("%d",&n); for(i=0;i<=n-1;i++) { printf("\nEnter no. of pages\n "); scanf("%d",&b[i].pages); printf("\nenter the name of book\n"); scanf("%s",b[i].name); printf("\nEnter price of book\n "); scanf("%f",&b[i].price);
#include void main() { struct book { char name[20]; int pages; float price; }b; printf("\n enter the book name="); scanf("%s",&b.name); printf("\n enter the pages="); scanf("%d",&b.pages); printf("\n enter the price="); scanf("%f",&b.price);
/*To display the information of book using array of stucture*/ #include void main() { int i; struct book { char name[100]; float price; int pages; }b[5];
for(i=0;i<=4;i++) { printf("\n\tEnter the name of book"); scanf("%s",b[i].name);
printf("\n\tEnter the price of book"); scanf("%f",&b[i].price);
printf("\n\tEnter the pages of book"); scanf("%d",&b[i].pages); }
char name[50]; float price; int pages; }b[10]; int i=0; for(i=0;i<=9;i++) { printf("\nEnter the name of book:"); scanf("%s",b[i].name); printf("\nEnter the price of book:"); scanf("%f",&b[i].price); printf("\nEnter the no.of pages:"); scanf("%d",&b[i].pages);
} for(i=0;i<=9;i++) { printf("\nName of Book:%s\nPrice of book:%f\nPages:%d\n",b[i].name,b[i].price,b[i].pages); } }
#include void main() { int i; struct Book { char name[2];
float price; int pages; }b[2]; for(i=0;i<2;i++) { printf("\nEnter the Name, Price,Pages of book \n"); scanf("%s%f%d",b[i].name,&b[i].price,&b[i].pages);
// display name,pages,price of book #include void main() { int i;
struct book { char name[200]; int pages; float price; }x[5]; for(i=0;i<=4;i++) { printf("\n\t Enter the name of book="); scanf("%s",x[i].name); printf("\n\t Enter the pages of book="); scanf("%d",&x[i].pages); printf("\n\t Enter the price of book="); scanf("%f",&x[i].price); } for(i=0;i<=4;i++) { printf("\n\tname=%s,\n\tpages=%d,\n\tprice=%f",x[i].name,x[i].pages,x[i].price); } }
#include void main() { struct book1 { char name[10]; float price; int pages; }b[10]; int i; for(i=0;i<=9;i++) { printf("\n\tEnter the name of boot\n\t"); scanf("%s",b[i].name); printf("\n\tEnter the price of book\n\t"); scanf("%f",&b[i].price); printf("\n\tEnter the pages of book\n\t"); scanf("%d",&b[i].pages); } for(i=0;i<=9;i++) { printf("\n\tBook Name=%s\n\tBook Price=%f\n\tBook Pages=%d",b[i].name,b[i].price,b[i].pages); } }
char name[50]; float price; int pages; }b[10]; int i=0; for(i=0;i<=9;i++) { printf("\nEnter the name of book:"); scanf("%s",b[i].name); printf("\nEnter the price of book:"); scanf("%f",&b[i].price); printf("\nEnter the no.of pages:"); scanf("%d",&b[i].pages);
} for(i=0;i<=9;i++) { printf("\nName of Book:%s\nPrice of book:%f\nPages:%d\n",b[i].name,b[i].price,b[i].pages); } }
// Using array of structure display details of 5 books #include #include void main() { int i; struct book { char name[20]; float price; int page; }b[5]; for(i=0;i<=4;i++) { printf("\n Enter name of book="); scanf("%s",b[i].name); printf("\n Enter price of book="); scanf("%f",&b[i].price); printf("\n Enter pages in book="); scanf("%d",&b[i].page);
} for(i=0;i<=4;i++) { printf(" \n Name of book =%s \t Price of book=%f \t Pages in book=%d \t",b[i].name,b[i].price,b[i].page); } }
//display info of book using array #include void main() {
struct book { char name[10]; float price; int pages; }b[5]; int i; for(i=0;i<=4;i++) { printf("\nenter the name of book"); scanf("%s",b[i].name); printf("\nenter the price of book"); scanf("%f",&b[i].price); printf("\nenter the pages of book"); scanf("%d",&b[i].pages); } for(i=0;i<=4;i++) { printf("\nname=%s,price=%f,pages=%d",b[i].name,b[i].price,b[i].pages); } }
/*display name,price,pages of book using array of structure*/ #include void main() { struct book { char name[10]; float price; int pages; }b[5]; int i; for(i=0;i<=4;i++) { printf("\n\t enter name of book"); scanf("%s",b[i].name); printf("\n\t enter price of book"); scanf("%f",&b[i].price); printf("\n\t enter pages of book"); scanf("%d",&b[i].pages); } for(i=0;i<=4;i++) { printf("\n\t name=%s \n\t price=%f \n\t pages=%d",b[i].name,b[i].price,b[i].pages); } }
/* structure of book by array of struct*/ #include void main() { int i; struct book { char name[10]; int pages; float price; }b[10];
for(i=0;i<=9;i++) { printf("\n\t enter name"); scanf("%s",b[i].name); printf("\n\t enter pages"); scanf("%d",&b[i].pages); printf("\n\t enter price"); scanf("%f",&b[i].price); }
#include void main() { struct book { char name[10]; float price; int pages; }b; {printf("\n enter the name of book"); scanf("%s",b.name); printf("\n enter the price of book"); scanf("\%f",&b.price); printf("\n enter the pages of book"); scanf("\%d",&b.pages); printf("\n\t book name=%s,book price=%f,book pages=%d",b.name,b.price,b.pages); } }
#include void main() { struct book { char name[20]; int pages; float price; }b; printf("\n enter the book name="); scanf("%s",&b.name); printf("\n enter the pages="); scanf("%d",&b.pages); printf("\n enter the price="); scanf("%f",&b.price);
/* structure of book by array of struct*/ #include void main() { int i; struct book { char name[10]; int pages; float price; }b[10];
for(i=0;i<=9;i++) { printf("\n\t enter name"); scanf("%s",b[i].name); printf("\n\t enter pages"); scanf("%d",&b[i].pages); printf("\n\t enter price"); scanf("%f",&b[i].price); }
printf("\n enter name of book"); scanf("\n%s",b.Name); printf("\n enter price of book"); scanf("\t%f",&b.price); printf("\nenter page of book"); scanf("\t%d",&b.page);
printf("\nbook name=%s\t book price=%f\t book page=%d",b.Name,b.price,b.page); }
#include void main() { int i; struct book { int pages; float price; char name[10]; }b[10]; for(i=0;i<10;i++) { printf("Enter the name"); scanf("\n%s",b[i].name); printf("Enter the price"); scanf("\n%f",&b[i].price); printf("Enter the pages"); scanf("\n%d",&b[i].pages); } for(i=0;i<10;i++) { printf("\nName of book=%s\nprice of book=%f\npages of book=%d\n",b[i].name,b[i].price,b[i].pages); }
#include void main() { int i; struct book { int pages; float price; char name[10]; }b[10]; for(i=0;i<10;i++) { printf("Enter the name"); scanf("\n%s",b[i].name); printf("Enter the price"); scanf("\n%f",&b[i].price); printf("Enter the pages"); scanf("\n%d",&b[i].pages); } for(i=0;i<10;i++) { printf("\nName of book=%s\nprice of book=%f\npages of book=%d\n",b[i].name,b[i].price,b[i].pages); }
/* program to accept multiple values of book using ARRAY OF STRUCT */
ReplyDelete#include
void main()
{
int i;
struct book
{
char name[100];
float price;
int pages;
}b[5];
for(i=0;i<=4;i++)
{
printf("\nEnter the name of book...");
scanf("%s",b[i].name);
printf("Enter the price of book...");
scanf("%f",&b[i].price);
printf("ENter the pages of book....");
scanf("%d",&b[i].pages);
}
for(i=0;i<=4;i++)
{
printf("\nNAME=%s \nPRICE=%f \nPAGES=%d\n\n",b[i].name,b[i].price,b[i].pages);
}
}
/* program to accept multiple values of book using ARRAY OF STRUCT */
ReplyDelete#include
void main()
{
int i;
struct book
{
char name[100];
float price;
int pages;
}b[5];
for(i=0;i<=4;i++)
{
printf("\nEnter the name of book...");
scanf("%s",b[i].name);
printf("Enter the price of book...");
scanf("%f",&b[i].price);
printf("ENter the pages of book....");
scanf("%d",&b[i].pages);
}
for(i=0;i<=4;i++)
{
printf("\nNAME=%s \nPRICE=%f \nPAGES=%d\n\n",b[i].name,b[i].price,b[i].pages);
}
}
#include
Deletevoid main()
{
int i;
struct book
{
char name[100];
float price;
int pages;
}b[5];
for(i=0;i<=4;i++)
{
printf("\nEnter the name of book...");
scanf("%s",b[i].name);
printf("Enter the price of book...");
scanf("%f",&b[i].price);
printf("ENter the pages of book....");
scanf("%d",&b[i].pages);
}
for(i=0;i<=4;i++)
{
printf("\nNAME=%s \nPRICE=%f \nPAGES=%d\n\n",b[i].name,b[i].price,b[i].pages);
}
}
#include
Deletevoid main()
{
struct employee
{
char n[20],mail[20];
int sal,contact;
}e;
printf("\n\tEnter name,contact no,salary and mail id of employee:\n\t");
scanf("%s%d%d%s",e.n,&e.contact,&e.sal,e.mail);
printf("\n\tEmployee Details are:\n\t1.NAME=%s \n\t2.CONTACT NO.=%d \n\t3.SALARY=%d \n\t4.MAIL ID=%s",e.n,e.contact,e.sal,e.mail);
}
well arranged,correct and stylish program lies here only!!
ReplyDelete#include
struct book
{
char name[20];
int pages;
float price;
}b[100];
void main()
{
int n,i;
printf("\n\nenter the number of books\n");
scanf("%d",&n);
for(i=0;i<=n-1;i++)
{
printf("\nEnter no. of pages\n ");
scanf("%d",&b[i].pages);
printf("\nenter the name of book\n");
scanf("%s",b[i].name);
printf("\nEnter price of book\n ");
scanf("%f",&b[i].price);
}
printf("name\tpages\tprice\n");
printf("------------------------------\n");
for(i=0;i<=n-1;i++)
{
printf("\n%s\t%d\t%f\t",b[i].name,b[i].pages,b[i].price);
}
}
#include
ReplyDeletevoid main()
{
struct book
{
char name[20];
int pages;
float price;
}b;
printf("\n enter the book name=");
scanf("%s",&b.name);
printf("\n enter the pages=");
scanf("%d",&b.pages);
printf("\n enter the price=");
scanf("%f",&b.price);
printf("\n name=%s",b.name);
printf("\n pages=%d",b.pages);
printf("\n price=%f",b.price);
}
/*To display the information of book using array of stucture*/
ReplyDelete#include
void main()
{
int i;
struct book
{
char name[100];
float price;
int pages;
}b[5];
for(i=0;i<=4;i++)
{
printf("\n\tEnter the name of book");
scanf("%s",b[i].name);
printf("\n\tEnter the price of book");
scanf("%f",&b[i].price);
printf("\n\tEnter the pages of book");
scanf("%d",&b[i].pages);
}
for(i=0;i<=4;i++)
{
printf("\n\tNAME=%s \n\tPRICE=%f \n\tPAGES=%d",b[i].name,b[i].price,b[i].pages);
}
}
#include
ReplyDeletevoid main()
{
struct book
{
char name[50];
float price;
int pages;
}b[10];
int i=0;
for(i=0;i<=9;i++)
{
printf("\nEnter the name of book:");
scanf("%s",b[i].name);
printf("\nEnter the price of book:");
scanf("%f",&b[i].price);
printf("\nEnter the no.of pages:");
scanf("%d",&b[i].pages);
}
for(i=0;i<=9;i++)
{
printf("\nName of Book:%s\nPrice of book:%f\nPages:%d\n",b[i].name,b[i].price,b[i].pages);
}
}
/* display the 10 books information*/
ReplyDelete#include
void main()
{
struct book
{
char name[10];
float price;
int pages;
}b[10];
int i;
for(i=0;i<=9;i++)
{
printf("\nenter name of book=");
scanf("%s",b[i].name);
printf("enter price of book=");
scanf("%f",&b[i].price);
printf("enter pages of book=");
scanf("%d",&b[i].pages);
}
for(i=0;i<=9;i++)
{
printf("\nbook name=%s,\nbook price=%f,\nbook pages=%d",b[i].name,b[i].price,b[i].pages);
}
}
#include
ReplyDeletevoid main()
{
int i;
struct Book
{
char name[2];
float price;
int pages;
}b[2];
for(i=0;i<2;i++)
{
printf("\nEnter the Name, Price,Pages of book \n");
scanf("%s%f%d",b[i].name,&b[i].price,&b[i].pages);
}
for(i=0;i<2;i++)
{
printf("\nName=%s\nPrice=%f\nPages=%d\n",b[i].name,b[i].price,b[i].pages);
}
}
// display name,pages,price of book
ReplyDelete#include
void main()
{
int i;
struct book
{
char name[200];
int pages;
float price;
}x[5];
for(i=0;i<=4;i++)
{
printf("\n\t Enter the name of book=");
scanf("%s",x[i].name);
printf("\n\t Enter the pages of book=");
scanf("%d",&x[i].pages);
printf("\n\t Enter the price of book=");
scanf("%f",&x[i].price);
}
for(i=0;i<=4;i++)
{
printf("\n\tname=%s,\n\tpages=%d,\n\tprice=%f",x[i].name,x[i].pages,x[i].price);
}
}
#include
ReplyDeletevoid main()
{
struct book1
{
char name[10];
float price;
int pages;
}b[10];
int i;
for(i=0;i<=9;i++)
{
printf("\n\tEnter the name of boot\n\t");
scanf("%s",b[i].name);
printf("\n\tEnter the price of book\n\t");
scanf("%f",&b[i].price);
printf("\n\tEnter the pages of book\n\t");
scanf("%d",&b[i].pages);
}
for(i=0;i<=9;i++)
{
printf("\n\tBook Name=%s\n\tBook Price=%f\n\tBook Pages=%d",b[i].name,b[i].price,b[i].pages);
}
}
#include
ReplyDeletevoid main()
{
struct book
{
char name[50];
float price;
int pages;
}b[10];
int i=0;
for(i=0;i<=9;i++)
{
printf("\nEnter the name of book:");
scanf("%s",b[i].name);
printf("\nEnter the price of book:");
scanf("%f",&b[i].price);
printf("\nEnter the no.of pages:");
scanf("%d",&b[i].pages);
}
for(i=0;i<=9;i++)
{
printf("\nName of Book:%s\nPrice of book:%f\nPages:%d\n",b[i].name,b[i].price,b[i].pages);
}
}
// Using array of structure display details of 5 books
ReplyDelete#include
#include
void main()
{
int i;
struct book
{
char name[20];
float price;
int page;
}b[5];
for(i=0;i<=4;i++)
{
printf("\n Enter name of book=");
scanf("%s",b[i].name);
printf("\n Enter price of book=");
scanf("%f",&b[i].price);
printf("\n Enter pages in book=");
scanf("%d",&b[i].page);
}
for(i=0;i<=4;i++)
{
printf(" \n Name of book =%s \t Price of book=%f \t Pages in book=%d \t",b[i].name,b[i].price,b[i].page);
}
}
//Book strcture
ReplyDelete#include
void main()
{
struct book
{
char name[10];
int pages;
float price;
}b[5];
int i;
for(i=0;i<=4;i++)
{
printf("Enter name\n pages \n price");
scanf("\n%s\n%d\n%f",b[i].name,&b[i].pages,&b[i].price);
printf("nane=%s \npages=%d \nprice=%f",b[i].name,b[i].pages,b[i].price);
}
}
//display info of book using array
ReplyDelete#include
void main()
{
struct book
{
char name[10];
float price;
int pages;
}b[5];
int i;
for(i=0;i<=4;i++)
{
printf("\nenter the name of book");
scanf("%s",b[i].name);
printf("\nenter the price of book");
scanf("%f",&b[i].price);
printf("\nenter the pages of book");
scanf("%d",&b[i].pages);
}
for(i=0;i<=4;i++)
{
printf("\nname=%s,price=%f,pages=%d",b[i].name,b[i].price,b[i].pages);
}
}
//program of displaying structure of book by using array
ReplyDelete#include
void main()
{
int i;
struct book
{
char name[10];
float price;
int pages;
}b[5];
for(i=1;i<=5;i++)
{
printf("\n Enter the name of the book::\n");
scanf("%s",b[i].name);
printf("\n Enter the price of the book::\n");
scanf("%f",&b[i].price);
printf("\n Enter the no of pages of the book::\n");
scanf("%d",&b[i].pages);
}
for(i=1;i<=5;i++)
{
printf("\n The name of the book::%s \n The price of book::%f \n The no of pagesof book::%d \n\n" ,b[i].name,b[i].price,b[i].pages);
}
}
/*display name,price,pages of book using array of structure*/
ReplyDelete#include
void main()
{
struct book
{
char name[10];
float price;
int pages;
}b[5];
int i;
for(i=0;i<=4;i++)
{
printf("\n\t enter name of book");
scanf("%s",b[i].name);
printf("\n\t enter price of book");
scanf("%f",&b[i].price);
printf("\n\t enter pages of book");
scanf("%d",&b[i].pages);
}
for(i=0;i<=4;i++)
{
printf("\n\t name=%s \n\t price=%f \n\t pages=%d",b[i].name,b[i].price,b[i].pages);
}
}
/* structure of book by array of struct*/
ReplyDelete#include
void main()
{
int i;
struct book
{
char name[10];
int pages;
float price;
}b[10];
for(i=0;i<=9;i++)
{
printf("\n\t enter name");
scanf("%s",b[i].name);
printf("\n\t enter pages");
scanf("%d",&b[i].pages);
printf("\n\t enter price");
scanf("%f",&b[i].price);
}
for(i=0;i<=9;i++)
{
printf("name=%spages=%dprice=%f",b[i].name,b[i].pages,b[i].price);
}
}
#include
ReplyDeletevoid main()
{int i;
struct book
{
char name[20];
float price;
int pages;
}p[5];
for(i=0;i<=4;i++)
{
printf("\nBook name=");
scanf("%s",p[i].name);
printf("\tPrice=");
scanf("%f",&p[i].price);
printf("\tenter no of pages=");
scanf("%d",&p[i].pages);
}
for(i=0;i<=4;i++)
{printf("Book name=%s",p[i].name);
printf("\tprice=%f\tpages=%d\n",p[i].price,p[i].pages);
}
}
#include
ReplyDeletevoid main()
{
struct book
{
char name[10];
float price;
int pages;
}b;
{printf("\n enter the name of book");
scanf("%s",b.name);
printf("\n enter the price of book");
scanf("\%f",&b.price);
printf("\n enter the pages of book");
scanf("\%d",&b.pages);
printf("\n\t book name=%s,book price=%f,book pages=%d",b.name,b.price,b.pages);
}
}
#include
ReplyDeletevoid main()
{
struct book
{
char name[20];
int pages;
float price;
}b;
printf("\n enter the book name=");
scanf("%s",&b.name);
printf("\n enter the pages=");
scanf("%d",&b.pages);
printf("\n enter the price=");
scanf("%f",&b.price);
printf("\n name=%s",b.name);
printf("\n pages=%d",b.pages);
printf("\n price=%f",b.price);
}
/* structure of book by array of struct*/
ReplyDelete#include
void main()
{
int i;
struct book
{
char name[10];
int pages;
float price;
}b[10];
for(i=0;i<=9;i++)
{
printf("\n\t enter name");
scanf("%s",b[i].name);
printf("\n\t enter pages");
scanf("%d",&b[i].pages);
printf("\n\t enter price");
scanf("%f",&b[i].price);
}
for(i=0;i<=9;i++)
{
printf("name=%spages=%dprice=%f",b[i].name,b[i].pages,b[i].price);
}
}
#include
ReplyDeletevoid main()
{
struct Book
{
char Name[10];
float price;
int page;
}b;
printf("\n enter name of book");
scanf("\n%s",b.Name);
printf("\n enter price of book");
scanf("\t%f",&b.price);
printf("\nenter page of book");
scanf("\t%d",&b.page);
printf("\nbook name=%s\t book price=%f\t book page=%d",b.Name,b.price,b.page);
}
#include
ReplyDeletevoid main()
{
int i;
struct book
{
int pages;
float price;
char name[10];
}b[10];
for(i=0;i<10;i++)
{
printf("Enter the name");
scanf("\n%s",b[i].name);
printf("Enter the price");
scanf("\n%f",&b[i].price);
printf("Enter the pages");
scanf("\n%d",&b[i].pages);
}
for(i=0;i<10;i++)
{
printf("\nName of book=%s\nprice of book=%f\npages of book=%d\n",b[i].name,b[i].price,b[i].pages);
}
}
#include
ReplyDeletevoid main()
{
int i;
struct book
{
int pages;
float price;
char name[10];
}b[10];
for(i=0;i<10;i++)
{
printf("Enter the name");
scanf("\n%s",b[i].name);
printf("Enter the price");
scanf("\n%f",&b[i].price);
printf("Enter the pages");
scanf("\n%d",&b[i].pages);
}
for(i=0;i<10;i++)
{
printf("\nName of book=%s\nprice of book=%f\npages of book=%d\n",b[i].name,b[i].price,b[i].pages);
}
}
/*array of structure*/
ReplyDelete#include
void main()
{
struct book
{
char name[20];
int price;
int pages;
}b[10];
int i;
for(i=0;i<9;i++)
{
printf("\n enter name");
scanf("%s",b[i].name);
printf("\n enter price");
scanf("%d",&b[i].price);
printf("\n enter pages");
scanf("%d",&b[i].pages);
}
for(i=0;i<9;i++)
{
printf("\n\t name=%s price=%d pages=%d",b[i].name,b[i].price,b[i].pages);
}
}
#include
ReplyDeletevoid main()
{
struct book
{
char name[20];
float price;
int pages:
}b[5];
int i;
for(i=0;i<=4;i++)
{
printf("\n\tenter name of book");
scanf("%s",b[i].name);
printf("\n enter price");
scanf("%f",&b[i].price);
printf("\n enter pages");
scanf("%d",&b[i].pages);
}
for(i=0;i<=4;i++)
{
printf("\n\tname=%s \n\tprice=%f \n\tpages=%d",b[i].name,b[i].price,b[i].pages);
}
}