#include void main() { struct book { char name; float price; int pages; }b; printf("\n\t Enter the name of book:") scanf("%s",b.name); printf("\n\t Enter the price of book:"); scanf("%f",&b.price); printf("\n\t 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); } }
correct program,only here!!@mubin // to display book info. #include void main() { struct book { int pg; char n[20]; float pr; }; struct book b1={200,"physics",427.50}; printf("\n\tpages:%d \n\t Name of book:%s \n\t price:%f", b1.pg,b1.n,b1.pr); }
/*To display the information about book*/ #include void main() { struct book { char name[10]; float price; int pages; }b; { printf("\n\t Enter the name of book"); scanf("%s",b.name);
printf("\n\t Enter the price of book"); scanf("%f",&b.price);
printf("\n\t Enter the no of pages of book"); scanf("%d",&b.pages);
printf("\n\tThe name of the book::%s \n\tThe price of book::%f \n\tThe no of pagesof book::%d \n\t" ,b.name,b.price,b.pages); } }
/*name ,price,pagesof book using structure*/ #include void main() { struct book { char name[10]; float price; int pages; }b; printf("\n\t enter name of book"); scanf("%s",b.name); printf("\n\t enter price of book"); scanf("%f",&b.price); printf("\n\t enter pages of book"); scanf("%d",&b.pages); printf("\n\t book name=%s \n\tbook price=%f \n\tbook pages=%d",b.name,b.price,b.pages); }
#include void main() { struct book { char name[30];
float price; int pages; }b; printf("\nEnter the name of book:\n"); scanf("%s",b.name); printf("\nEnter the price of book:\n"); scanf("%f",&b.price); printf("\nEnter the pages of book:\n"); scanf("%d",&b.pages); printf("\nInformation about book:\n"); printf("\nName of book:%s\nPrice of book=%f\nPages of book:%d\n",b.name,b.price,b.pages);
#include void main() { struct Book { char name[10]; float price; int pages; }b; int i; printf("\n\tEnter Name of Book\n\t"); scanf("%s",b.name); printf("\n\tEnter price of Book\n\t"); scanf("%f",&b.price); printf("\n\tEnter Pages of Book\n\t"); scanf("%d",&b.pages);
#include void main() { struct Book { char name[2];
float price; int pages; }b; printf("\nEnter the Name, Price,Pages of book \n"); scanf("%s%f%d",b.name,&b.price,&b.pages); printf("\nName=%s\nPrice=%f\nPages=%d\n",b.name,b.price,b.pages);
// to display book info. #include void main() { struct book { int pg; char n[20]; float pr; }; struct book b1={200,"physics",427.50}; printf("\n\tpages:%d \n\t Name of book:%s \n\t price:%f", b1.pg,b1.n,b1.pr); }
#include void main() { struct book { char name[20]; int pages; int price; }x; printf("\n enter the book name="); scanf("%s",&x.name); printf("\n enter the pages="); scanf("%d",&x.pages); printf("\n enter the price="); scanf("%d",&x.price);
#include void main() { struct book { char name[10]; float price; int pages; }b; printf("\n\tEnter the name of book"); scanf("%s",b.name); printf("\n\tEnter the price of book"); scanf("%f",&b.price); printf("\n\tEnter the pages of book"); scanf("%d",&b.pages);
// Using structure display details about book #include #include void main() { struct book { char name[20]; float price; int page; }b; printf("\n Enter name of book="); gets(b.name); printf("\n Enter price of book="); scanf("%f",&b.price); printf("\n Enter pages in book="); scanf("%d",&b.page); printf("\n Name of book=%s"); puts(b.name); printf("\n Price of book=%f \n Pages in book=%d\n",b.price,b.page); }
//display info of book #include void main() { struct book { char name[10]; float price; int pages; }b; printf("\n\tEnter the name of book"); scanf("%s",b.name); printf("\n\tEnter the price of book"); scanf("%f",&b.price); printf("\n\tEnter the pages of book"); scanf("%d",&b.pages);
#include void main() { struct book { char name[10]; float price; int pages; }b; printf("\n\t enter the name of book"); scanf("%s",b.name); printf("\n\t enter the price of book"); scanf("%f",&b.price); printf("\n\t 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[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[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[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); } }
/* information of book */ #include void main() { struct book; { char name[10]; float price; int pages; }b; printf("enter the name of book"); scanf("%s",b.book name); printf("enter the price of book"); scanf("%f",b.price); printf("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);
// to display book info using structure #include void main() { struct bk { int pagge; char name[20]; float prize; }; struct bk b={400,"Data Structure",500.50}; printf("\n\tPages:%d \n\t Name of book:%s \n\t Price:%f", b.pg,b.n,b.pr); }
#include struct book { char name[10]; float price; int pages; }b; void main() { printf("\n\tenter the name of book"); scanf("%s",&b.name); printf("\n\tenter the price of book"); scanf("%f",&b.price); printf("\n\tenter the pages of book"); scanf("%d",&b.pages); printf("\n\tthe name of the book=%s,\nthe price of the book=%f,\nthe pages of the book=%d\n",b.name,b.price,b.pages); }
struct book { char Name[10]; float price; int page; } b[10]; int i; for(i=0;i<=9;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 page of book"); scanf("%d",&b[i].page);
#include void main() { struct book { int pages; float price; char name[10]; }b; printf("Enter the name"); scanf("\n%s",b.name); printf("Enter the price"); scanf("\n%f",&b.price); printf("Enter the pages"); scanf("\n%d",&b.pages); printf("\nName of book=%s\nprice of book=%f\npages of book=%d\n",b.name,b.price,b.pages);
#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); } }
/*To display the information about book*/ #include void main() { struct book { char name[10]; float price; int pages; }b; { printf("\n\t Enter the name of book"); scanf("%s",b.name);
printf("\n\t Enter the price of book"); scanf("%f",&b.price);
printf("\n\t Enter the no of pages of book"); scanf("%d",&b.pages);
printf("\n\tThe name of the book::%s \n\tThe price of book::%f \n\tThe no of pagesof book::%d \n\t" ,b.name,b.price,b.pages); } }
/*Book info using structure*/ #include void main() { struct book { char name[20]; float price; int pages; }b; int i; printf("\n enter name of book"); scanf("%s",b.name); printf("\n enter price of book"); scanf("%f",&b.price); printf("\n enter 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]; float price; int pages; }b; printf("\n\t enter book name \n\t enter price \n\tenter pages"); scanf("%s%f%d",b.name,&b.price,&b.pages); printf("\n\tname=%s \n\t price=%f \n\tpages=%d",b.name ,b.price,b.pages); }
/* Display name of book,pages and price using structure.*/
ReplyDelete#include
void main()
{
struct book
{
char name[10];
float price;
int pages;
}b;
printf("\n Enter the name of the book::\n");
scanf("%s",b.name);
printf("\n Enter the price of the book::\n");
scanf("%f",&b.price);
printf("\n Enter the no of pages of the book::\n");
scanf("%d",&b.pages);
printf("\n The name of the book::%s \n The price of book::%f \n The no of pagesof book::%d \n\n" ,b.name,b.price,b.pages);
}
#include
Deletevoid main()
{
struct book
{
char name[10];
float price;
int pages;
}b;
printf("\n Enter the name of the book::\n");
scanf("%s",b.name);
printf("\n Enter the price of the book::\n");
scanf("%f",&b.price);
printf("\n Enter the no of pages of the book::\n");
scanf("%d",&b.pages);
printf("\n The name of the book::%s \n The price of book::%f \n The no of pagesof book::%d \n\n" ,b.name,b.price,b.pages);
}
/* Display the information of book using stucture */
ReplyDelete#include
void main()
{
struct book
{
char name[100];
float price;
int page;
}b;
printf("\nEnter the book name...");
scanf("%s",b.name);
printf("\nEnter the price of book...");
scanf("%f",&b.price);
printf("\nEnter the pages of book....");
scanf("%d",&b.page);
printf("\nBook Name=%s \nBook price=%f \nBook page=%d",b.name,b.price,b.page);
}
#include
ReplyDeletevoid main()
{
struct book
{
char name;
float price;
int pages;
}b;
printf("\n\t Enter the name of book:")
scanf("%s",b.name);
printf("\n\t Enter the price of book:");
scanf("%f",&b.price);
printf("\n\t 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);
}
}
/* Display name of book,pages and price using structure.*/
ReplyDelete#include
void main()
{
struct book
{
char name[10];
float price;
int pages;
}b;
printf("\n Enter the name of the book::\n");
scanf("%s",b.name);
printf("\n Enter the price of the book::\n");
scanf("%f",&b.price);
printf("\n Enter the no of pages of the book::\n");
scanf("%d",&b.pages);
printf("\n The name of the book::%s \n The price of book::%f \n The no of pagesof book::%d \n\n" ,b.name,b.price,b.pages);
}
/* Display the information of book using stucture */
ReplyDelete#include
void main()
{
struct book
{
char name[100];
float price;
int page;
}b;
printf("\nEnter the book name...");
scanf("%s",b.name);
printf("\nEnter the price of book...");
scanf("%f",&b.price);
printf("\nEnter the pages of book....");
scanf("%d",&b.page);
printf("\nBook Name=%s \nBook price=%f \nBook page=%d",b.name,b.price,b.page);
}
correct program,only here!!@mubin
ReplyDelete// to display book info.
#include
void main()
{
struct book
{
int pg;
char n[20];
float pr;
};
struct book b1={200,"physics",427.50};
printf("\n\tpages:%d \n\t Name of book:%s \n\t price:%f", b1.pg,b1.n,b1.pr);
}
/* Display name of book,pages and price using structure.*/
ReplyDelete#include
void main()
{
struct book
{
char name[10];
float price;
int pages;
}b;
printf("\n Enter the name of the book::\n");
scanf("%s",b.name);
printf("\n Enter the price of the book::\n");
scanf("%f",&b.price);
printf("\n Enter the no of pages of the book::\n");
scanf("%d",&b.pages);
printf("\n The name of the book::%s \n The price of book::%f \n The no of pagesof book::%d \n\n" ,b.name,b.price,b.pages);
}
/*To display the information about book*/
ReplyDelete#include
void main()
{
struct book
{
char name[10];
float price;
int pages;
}b;
{
printf("\n\t Enter the name of book");
scanf("%s",b.name);
printf("\n\t Enter the price of book");
scanf("%f",&b.price);
printf("\n\t Enter the no of pages of book");
scanf("%d",&b.pages);
printf("\n\tThe name of the book::%s \n\tThe price of book::%f \n\tThe no of pagesof book::%d \n\t" ,b.name,b.price,b.pages);
}
}
/*name ,price,pagesof book using structure*/
ReplyDelete#include
void main()
{
struct book
{
char name[10];
float price;
int pages;
}b;
printf("\n\t enter name of book");
scanf("%s",b.name);
printf("\n\t enter price of book");
scanf("%f",&b.price);
printf("\n\t enter pages of book");
scanf("%d",&b.pages);
printf("\n\t book name=%s \n\tbook price=%f \n\tbook pages=%d",b.name,b.price,b.pages);
}
#include
ReplyDeletevoid main()
{
struct book
{
char name[30];
float price;
int pages;
}b;
printf("\nEnter the name of book:\n");
scanf("%s",b.name);
printf("\nEnter the price of book:\n");
scanf("%f",&b.price);
printf("\nEnter the pages of book:\n");
scanf("%d",&b.pages);
printf("\nInformation about book:\n");
printf("\nName of book:%s\nPrice of book=%f\nPages of book:%d\n",b.name,b.price,b.pages);
}
/* Book information are Display*/
ReplyDelete#include
void main()
{
struct book
{
char name[10];
float price;
int pages;
}b;
printf("\nenter name of book=");
scanf("%s",b.name);
printf("enter price of book=");
scanf("%f",&b.price);
printf("enter pages of book=");
scanf("%d",&b.pages);
printf("\nbook name=%s,\nbook price=%f,\nbook pages=%d",b.name,b.price,b.pages);
}
#include
ReplyDeletevoid main()
{
struct Book
{
char name[10];
float price;
int pages;
}b;
int i;
printf("\n\tEnter Name of Book\n\t");
scanf("%s",b.name);
printf("\n\tEnter price of Book\n\t");
scanf("%f",&b.price);
printf("\n\tEnter Pages of Book\n\t");
scanf("%d",&b.pages);
printf("\n\tBook Name=%s,\n\tBook Price=%f,\n\tBook pages=%d",b.name,b.price,b.pages);
}
#include
ReplyDeletevoid main()
{
struct Book
{
char name[2];
float price;
int pages;
}b;
printf("\nEnter the Name, Price,Pages of book \n");
scanf("%s%f%d",b.name,&b.price,&b.pages);
printf("\nName=%s\nPrice=%f\nPages=%d\n",b.name,b.price,b.pages);
}
// to display book info.
ReplyDelete#include
void main()
{
struct book
{
int pg;
char n[20];
float pr;
};
struct book b1={200,"physics",427.50};
printf("\n\tpages:%d \n\t Name of book:%s \n\t price:%f", b1.pg,b1.n,b1.pr);
}
//display n count even no using while loop
ReplyDelete#include
void main()
{
int count=0,i=1;
while(i<=100)
{
if(i%2==0)
{
printf("\ngiven even no==%d",i);
count++;
}
i++;
}
printf("\ntotal even no=%d",count);
}
#include
ReplyDeletevoid main()
{
struct book
{
char name[20];
int pages;
int price;
}x;
printf("\n enter the book name=");
scanf("%s",&x.name);
printf("\n enter the pages=");
scanf("%d",&x.pages);
printf("\n enter the price=");
scanf("%d",&x.price);
printf("\n name=%s",x.name);
printf("\n pages=%d",x.pages);
printf("\n price=%d",x.price);
}
#include
ReplyDeletevoid main()
{
struct book
{
char name[10];
float price;
int pages;
}b;
printf("\n\tEnter the name of book");
scanf("%s",b.name);
printf("\n\tEnter the price of book");
scanf("%f",&b.price);
printf("\n\tEnter the pages of book");
scanf("%d",&b.pages);
printf("\n\tBook Name=%s,Book Price=%f,Book Pages=%d",b.name,b.price,b.pages);
}
// Using structure display details about book
ReplyDelete#include
#include
void main()
{
struct book
{
char name[20];
float price;
int page;
}b;
printf("\n Enter name of book=");
gets(b.name);
printf("\n Enter price of book=");
scanf("%f",&b.price);
printf("\n Enter pages in book=");
scanf("%d",&b.page);
printf("\n Name of book=%s");
puts(b.name);
printf("\n Price of book=%f \n Pages in book=%d\n",b.price,b.page);
}
//Book strcture
ReplyDelete#include
void main()
{
struct book
{
char name[10];
int pages;
float price;
}b;
printf("Enter name\n pages \n price");
scanf("\n%s\n%d\n%f",b.name,&b.pages,&b.price);
printf("nane=%s \npages=%d \nprice=%f",b.name,b.pages,b.price);
}
//display info of book
ReplyDelete#include
void main()
{
struct book
{
char name[10];
float price;
int pages;
}b;
printf("\n\tEnter the name of book");
scanf("%s",b.name);
printf("\n\tEnter the price of book");
scanf("%f",&b.price);
printf("\n\tEnter the pages of book");
scanf("%d",&b.pages);
printf("\n\tBook Name=%s,Book Price=%f,Book Pages=%d",b.name,b.price,b.pages);
}
#include
ReplyDeletevoid main()
{
struct book
{
char name[10];
float price;
int pages;
}b;
printf("\n\t enter the name of book");
scanf("%s",b.name);
printf("\n\t enter the price of book");
scanf("%f",&b.price);
printf("\n\t 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);
}
//program of displaying structure of book
ReplyDelete#include
void main()
{
struct book
{
char name[10];
float price;
int pages;
}b;
printf("\n Enter the name of the book::\n");
scanf("%s",b.name);
printf("\n Enter the price of the book::\n");
scanf("%f",&b.price);
printf("\n Enter the no of pages of the book::\n");
scanf("%d",&b.pages);
printf("\n The name of the book::%s \n The price of book::%f \n The no of pagesof book::%d \n\n" ,b.name,b.price,b.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
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[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];
float price;
int pages;
}p;
printf("\nBook name=");
scanf("%s",p.name);
printf("\nPrice=");
scanf("%f",&p.price);
printf("\nenter no of pages=");
scanf("%d",&p.pages);
printf("name of book=%s\tprice=%f\tpages=%d\n",p.name,p.price,p.pages);
}
/* information of book */
ReplyDelete#include
void main()
{
struct book;
{
char name[10];
float price;
int pages;
}b;
printf("enter the name of book");
scanf("%s",b.book name);
printf("enter the price of book");
scanf("%f",b.price);
printf("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);
/* add of 2d array*/
ReplyDelete#include
void main()
{
int a[2][2];int b[2][2];
int c[2][2]; int i,j;
for(i=0;i<=1;i++)
{
for(j=0;j<=1;j++)
{
printf("\n\t enter 1st array");
scanf("%d",&a[i][j]);
}
}
for(i=0;i<=1;i++)
{
for(j=0;j<=1;j++)
{
printf("\n\t enter array");
scanf("%d",&b[i][j]);
}
}
for(i=0;i<=1;i++)
{
for(j=0;j<=1;j++)
{
c[i][j]=a[i][j]+b[i][j];
printf("%d",&c[i][j]);
}
}
}
This comment has been removed by the author.
ReplyDelete// to display book info using structure
ReplyDelete#include
void main()
{
struct bk
{
int pagge;
char name[20];
float prize;
};
struct bk b={400,"Data Structure",500.50};
printf("\n\tPages:%d \n\t Name of book:%s \n\t Price:%f", b.pg,b.n,b.pr);
}
#include
ReplyDeletestruct book
{
char name[10];
float price;
int pages;
}b;
void main()
{
printf("\n\tenter the name of book");
scanf("%s",&b.name);
printf("\n\tenter the price of book");
scanf("%f",&b.price);
printf("\n\tenter the pages of book");
scanf("%d",&b.pages);
printf("\n\tthe name of the book=%s,\nthe price of the book=%f,\nthe pages of the book=%d\n",b.name,b.price,b.pages);
}
#include
ReplyDeletevoid main()
{
struct book
{
char Name[10];
float price;
int page;
}
b[10];
int i;
for(i=0;i<=9;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 page of book");
scanf("%d",&b[i].page);
}
for(i=0;i<=9;i++)
{
printf("\n Name=%s,price=%f, page=%d",b[i].Name,b[i].price,b[i].page);
}
}
#include
ReplyDeletevoid main()
{
struct book
{
int pages;
float price;
char name[10];
}b;
printf("Enter the name");
scanf("\n%s",b.name);
printf("Enter the price");
scanf("\n%f",&b.price);
printf("Enter the pages");
scanf("\n%d",&b.pages);
printf("\nName of book=%s\nprice of book=%f\npages of book=%d\n",b.name,b.price,b.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);
}
}
/*To display the information about book*/
ReplyDelete#include
void main()
{
struct book
{
char name[10];
float price;
int pages;
}b;
{
printf("\n\t Enter the name of book");
scanf("%s",b.name);
printf("\n\t Enter the price of book");
scanf("%f",&b.price);
printf("\n\t Enter the no of pages of book");
scanf("%d",&b.pages);
printf("\n\tThe name of the book::%s \n\tThe price of book::%f \n\tThe no of pagesof book::%d \n\t" ,b.name,b.price,b.pages);
}
}
/*Book info using structure*/
ReplyDelete#include
void main()
{
struct book
{
char name[20];
float price;
int pages;
}b;
int i;
printf("\n enter name of book");
scanf("%s",b.name);
printf("\n enter price of book");
scanf("%f",&b.price);
printf("\n enter 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];
float price;
int pages;
}b;
printf("\n\t enter book name \n\t enter price \n\tenter pages");
scanf("%s%f%d",b.name,&b.price,&b.pages);
printf("\n\tname=%s \n\t price=%f \n\tpages=%d",b.name ,b.price,b.pages);
}