-
What will be the output of this program?
#include
using namespace std;
int main()
{
struct MansWear
{
string Brand;
double price;
};
MansWear MansWear1, MansWear2;
MansWear1.Brand = "Peter England";
MansWear1.price = 999.99;
cout << MansWear1.Brand << " $ "<MansWear2 = MansWear1;
MansWear2.price = MansWear2.price / 10;
cout << MansWear1.Brand << " $ "<< MansWear2.price;
return 0;
}
-
- Peter England $ 999.99
- Peter England $ 99.999
- Peter England $ 999.99
Peter England $ 99.999 - Peter England $ 99.999
Peter England $ 999.99 - None of these
Correct Option: C
We copied the value of MansWear1 into MansWear2 and divide the MansWear2 value by 10, So this is the output.
Peter England $ 999.99
Peter England $ 99.999