Computer Science, asked by IBRAHIM8564, 2 months ago

Consider the following structure definition
struct Book
{
int bookno; char title[20]; char author[20]; float price;
};
a) Declare a structure variable with name "mybook" and initialize the following data.
bookno=101, title="DBMS", author="Alexis Leon", price=400.0
b. Write a main program to display the details of the variable "mybook"

Answers

Answered by 1804026
0

Answer:

a) struct Book mybook;

mybook. bookno=101;

mybook. title="DBMS";

mybook. author="Alexis Leon";

mybook. price="400.0";

b) int main() {

cout<<mybook. bookno<<endl;

cout<<mybook. title<<endl;

cout<<mybook. author<<endl;

cout<<mybook. price<<endl;

return 0;

}

Similar questions