100% prog .. structure for data of 2 books
// Online C compiler to run C program online
#include <stdio.h>
void main()
{
struct bookz
{
int nop;
char name;
float price;
}b1,b2;
printf("\n enter name of the book:");
scanf("%c",&b1.name);
printf("\n enter no of pages:");
scanf("%d",&b1.nop);
printf("\n enter PRICE OF book:");
scanf("%f",&b1.price);
printf("\n enter name of the book:");
scanf("%c",&b2.name);
printf("\n enter no of pages:");
scanf("%d",&b2.nop);
printf("\n enter PRICE OF book:");
scanf("%f",&b2.price);
printf("\n name of the book:%c",b1.name);
printf("\n no of pages:%d",b1.nop);
printf("\n price:%f",b1.price);
printf("\n \n name of the book:%c",b2.name);
printf("\n no of pages:%d",b2.nop);
printf("\n price:%f",b2.price);
}
#include <stdio.h>
void main()
{
struct bookz
{
int nop;
char name;
float price;
}b1,b2;
printf("\n enter name of the book:");
scanf("%c",&b1.name);
printf("\n enter no of pages:");
scanf("%d",&b1.nop);
printf("\n enter PRICE OF book:");
scanf("%f",&b1.price);
printf("\n enter name of the book:");
scanf("%c",&b2.name);
printf("\n enter no of pages:");
scanf("%d",&b2.nop);
printf("\n enter PRICE OF book:");
scanf("%f",&b2.price);
printf("\n name of the book:%c",b1.name);
printf("\n no of pages:%d",b1.nop);
printf("\n price:%f",b1.price);
printf("\n \n name of the book:%c",b2.name);
printf("\n no of pages:%d",b2.nop);
printf("\n price:%f",b2.price);
}
తెరమీద
enter name of the book:z
enter no of pages:200
enter PRICE OF book:30.50
enter name of the book:y
enter no of pages:300
enter PRICE OF book:40.75
name of the book:z
no of pages:200
price:30.500000
name of the book:y
no of pages:300
price:40.750000
enter name of the book:z
enter no of pages:200
enter PRICE OF book:30.50
enter name of the book:y
enter no of pages:300
enter PRICE OF book:40.75
name of the book:z
no of pages:200
price:30.500000
name of the book:y
no of pages:300
price:40.750000
కామెంట్లు
కామెంట్ను పోస్ట్ చేయండి
దయచేసి మీ సలహాలను సూచనలను స్పష్టంగా పేర్కొనగలరు. plz see that ur comments are 'acceptable' in a value based society.