QUESTION- IMPLEMENT A LOGIC FOR NESTED STRUCTURE IN CPP
ANSWER-
#include<conio.h>
#include<iostream.h>
using namespace std;
struct bookout
{
char name[25];
int price;
int pages;
struct bookin
{
char isbn[10];
char author[25];
int pub_yr;
}b;
};
int main()
{
struct bookout a;
cout<<“\nBOOK DESCRIPTION :)\n”;
cout<<“\nNAME OF BOOK : “;
cin>>a.name;
cout<<“\nPRICE : “;
cin>>a.price;
cout<<“\nPAGES : “;
cin>>a.pages;
cout<<“\nISBN NO. : “;
cin>>a.b.isbn;
cout<<“\nAUTHOR : “;
cin>>a.b.author;
cout<<“\nPUBLICATION YEAR : “;
cin>>a.b.pub_yr;
cout<<“\n\nBOOK DESCRIPTION output 🙂 —- \n\n”
<<“\nNAME:\t”<<a.name
<<“\nPRICE:\t”<<a.price
<<“\nPAGES:\t”<<a.pages
<<“\nISBN NO.:\t”<<a.b.isbn
<<“\nAUTHOR:\t”<<a.b.author
<<“\nPUBLICATION YEAR:\t”<<a.b.pub_yr;
cout<<“\n\nPROGRAMMING @ C#ODE STUDIO”;
getch();
}