Question
1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
struct ShoeType {
6.
string style;
7.
double price;
8.
};
9.
ShoeType shoe1, shoe2;
10.
shoe1.style = "Adidas";
11.
shoe1.price = 9.99;
12.
cout
What will be the output of this program?
1.
#include
2.
using namespace std;
3.
int main()
4.
{
5.
struct ShoeType {
6.
string style;
7.
double price;
8.
};
9.
ShoeType shoe1, shoe2;
10.
shoe1.style = "Adidas";
11.
shoe1.price = 9.99;
12.
cout
Answer: Option A
Was this answer helpful ?
We copied the value of shoe1 into shoe2 and divide the shoe2 value by 9, So this is the output.
Output:
$ g++ stu2.cpp
$ a.out
Adidas $ 9.99
Adidas $ 1.11
Was this answer helpful ?
Submit Solution