Computer Science, asked by aryanbanafal7, 6 months ago

Write a C program to declare structure of student with data members book,prize and page.

Answers

Answered by himanshu2006vps
1

#include<stdio.h>

main()

{

struct book

{

char name[23];

float price;

int pages;

};

struct book b1, b2 ;

printf("\nEnter names, prices & no. of pages of 2 books\n");

scanf("%s %f %d", &b1.name, &b1.price, &b1.pages);

scanf("%s %f %d", &b2.name, &b2.price, &b2.pages);

printf("\n%s %f %d", b1.name, b1.price, b1.pages);

printf("\n%s %f %d", b2.name, b2.price, b2.pages);

}


aryanbanafal7: not the same question bro u copied the answer
himanshu2006vps: ok wait I got to know
himanshu2006vps: see
himanshu2006vps: how much book should I include
himanshu2006vps: 1 or 2 or 3 or 4
aryanbanafal7: 2 is fine
himanshu2006vps: ok
Similar questions