//Write a program that declares a structure to store Book ID, price and pages of a book. it defines two structure variable and inputs values.
//it displays the record of most costly book.
#include<iostream>
#include<conio.h>
#include<string>
usingnamespace std;
struct book
{
string id;
string price;
string pages;
};
main()
{
book b[2];
for(int i=0;i<2;i++)
{
cout<<"enter the book id ";
cin>>b[i].id;
cout<<"enter its price ";
cin>>b[i].price;
cout<<"enter its number of pages ";
cin>>b[i].pages;
}
string priceofbook1=b[0].price;
string priceofbook2=b[1].price;
string temp=0;
for(int i=0;i<2;i++)
{
// if(b[0].price<b[1].price)
if(temp<b[i].price)
{
temp=b[i].price;
//cout<<"highest price is"<<b[1].price;
// break;
}
//else
//{
//n=b[i].price;
//cout<<"highest price is"<<b[0].price;
}
cout<<"highest price is"<<temp;
//}
_getch();
}