structures usage

// struct
#include<iostream>
using namespace std;
#include<string>
# define total 90

int main(){
struct abc{//structure template
string author;
string book;
float price;
};
 
struct abc libry;
cout<<"cout now enter name of book "<<endl;
cin>>libry.book;
cout<<endl<<"now enter author's name "<<endl;
cin>>libry.author;
cout<<endl<<"cout enter price of book "<<endl;
cin>>libry.price;

cout<<libry.book<<" is written by "<<libry.author<<"  and its price is = "<<libry.price<<endl;

}











Previous
Next Post »

Comments:

Disqus Shortname