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);
}


తెరమీద 
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

కామెంట్‌లు

ఈ బ్లాగ్ నుండి ప్రసిద్ధ పోస్ట్‌లు

100% C prog to write content into a file and then read it back onto the console

Spic macay

శ్రీరస్తు.. రామలింగ 18-1-24 (సూరసాని వారి ఆహ్వానము)