Sail E0 Webinar
Question


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
Options:
A .  Adidas $ 9.99 Adidas $ 1.11
B .  Adidas $ 9.99 Adidas $ 9.11
C .  Adidas $ 9.99 Adidas $ 11.11
D .  none of the mentioned
Answer: Option A

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 ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

More Questions on This Topic :

Latest Videos

Latest Test Papers