76 311
Assignments Done
Successfully Done
In May 2019

Answer to Question #16434 in C++ for arif hussain

Question #16434
Q#2 • Write a program that defines the structure "part", having three members: Model number (int) Part number (int) Cost (float) Assign the value to the members of the structure. Define two structure variables part1 and part2. Initialize part1, print out the values of its members, assign part1 to part2, and print out is members.
Expert's answer
using namespace std;

struct part{
int mod_num, part_num;
float cost;
} part1, part2;

void main(){
cout<<"enter the model number: ";
cout<<"enter the part number: ";
cout<<"enter the cost: ";
part2 = part1;
cout<<part2.mod_num<<" "<<part2.part_num<<" "<<part2.cost<<"\n";

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions