Consider the following type definition:
struct ShoeType
{
char style;
double price;
};
Given this structure type definition, what will be the output produced by
the following code?
ShoeType shoe1, shoe2;
shoe1.style ='A';
shoe1.price = 9.99;
cout << shoe1.style << " $" << shoe1.price << endl;
shoe2 = shoe1;
shoe2.price = shoe2.price/9;
cout << shoe2.style << " $" << shoe2.price << endl;
OUTPUT:
Complete Program Code:
#include <iostream>
using namespace std;
struct ShoeType
{
char style;
double price;
};
int main()
{
ShoeType shoe1, shoe2;
shoe1.style ='A';
shoe1.price = 9.99;
cout << shoe1.style << " $" << shoe1.price << endl;
shoe2 = shoe1;
shoe2.price = shoe2.price/9;
cout << shoe2.style << " $" << shoe2.price << endl;
system("pause");
return 0;
}