0

Structure in c

how to make a structure in c named bookrecord to make author name and title name of the book. #include<stdio.h> #include<conio.h> struct bookrecord { char name[10]; char title[10]; }book={"J","Rainbook"}; int main() { }

9th Jun 2018, 5:03 PM
Jordan
Jordan  - avatar
3 ответов
+ 4
Well. You already have the struct. All you need to do, is to use it. printf("%s\n", book.name); printf("%s\n", book.title);
9th Jun 2018, 5:09 PM
Hatsy Rei
Hatsy Rei - avatar
0
Aint working properly #include<stdio.h> struct bookrecord { char name[10]; char title[10]; }; int main() { struct bookrecord b; printf("Enter book aurthor name "); scanf("%s ",&b.name); printf("Enter book name "); scanf("%s ",&b.title); printf("Book Details "); printf("Book name = %s ",b.name); printf("Book title = %s ",b.title); return 0; }
9th Jun 2018, 5:29 PM
Jordan
Jordan  - avatar
9th Jun 2018, 7:29 PM
hinanawi
hinanawi - avatar