Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am in learning stage of cpp(c++).Currently I am doing structures.I have write the following code but instead of getting input two times and giving

I am in learning stage of cpp(c++).Currently I am doing structures.I have write the following code but instead of getting input two times and giving output two times it is not working on the first part works perfeclty.

code:

#include using namespace std;

struct Person { char name[50]; int age; float salary; };

int main() { Person p1;

cout > p1.age; cout > p1.salary;

cout

Person p2;

cout > p2.age; cout > p2.salary;

cout

return 0; }

would you please tell me what i am doing wrong?image text in transcribed

C Microsoft Visual Studio Debug Console Enter Full name: joe Enter age: 21 Enter salary: 1234214 Displaying Information. Name: joe Age: 21 Salary: 1.23421e+06Enter Full name: Enter age: Enter salary: Displaying Information. Name: Age: -858993460 Salary: -1.07374e+08 C:\Users\RBTG source repos ConsoleApplication 12 \Debug\ConsoleApplication12.exe (process 14012) exited with code 0. To automatically close the console when debugging stops, enable Tools->Options ->Debugging->Automatically close the conso le when debugging stops. Press any key to close this window ... The bod1010 Stad Grade

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions