Professional Documents
Culture Documents
h> void main () { struct product { char name[15]; float price; }pr[5];
for (int i=0;i<5;i++) {cout<<"enter the name of product no"<<i+1<<endl; cin>>pr[i].name;} for (int j=0;j<5;j++) {cout<<"enter the price of product no"<<j+1<<endl; cin>>pr[j].price; }
} cout<<"the name of products in ascending order of prices are"<<endl; for (int k=0;k<5;k++) cout<<pr[k].name<<endl;