Question: Find the Errors in the C++ Programs struct TwoVals { int a, b; }; int main () { TwoVals.a = 10; TwoVals.b = 20; return

Find the Errors in the C++ Programs

struct TwoVals

{

int a, b;

};

int main ()

{

TwoVals.a = 10;

TwoVals.b = 20;

return 0;

}

#include

using namespace std;

struct ThreeVals

{

int a, b, c;

};

int main()

{

ThreeVals vals = {1, 2, 3};

cout << vals << endl;

return 0;

}

#include

#include

using namespace std;

struct names

{

string first;

string last;

};

int main ()

{

names customer = "Smith", "Orley";

cout << names.first << endl;

cout << names.last << endl;

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!