Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can someone helo Take a look at the following code snippet: struct Person{ char name[BUFSIZ]; char ssn[BUFSIZ]; int age; float height; float weight; }; struct

can someone helo

Take a look at the following code snippet:

struct Person{ char name[BUFSIZ]; char ssn[BUFSIZ]; int age; float height; float weight;

};

struct Person p1;

strcpy(p1.name, "Alfred Morino"); strcpy(p1.ssn, "496-50-2260"); p1.age = 50; p1.height = 170.5;

p1.weight = 70.5;

struct Person *ptr = &p1;

What will be printed by the following expressions?

printf("Name = %s SSN = %s Age = %d Height(cm) = %g Weight(kg) = %g ", p1.name, p1.ssn,p1.age, p1.height, p1.weight);

2 pts

5 pts

4 pts

printf("Name = %s SSN = %s Age = %d Height(cm) = %g Weight(kg) = %g ", ptr- >name, ptr->ssn, ptr->age, ptr->height, ptr->weight);

printf("Name = %s SSN = %s Age = %d Height(cm) = %g Weight(kg) = %g ", (*ptr).name, (*ptr).ssn, (*ptr).age, (*ptr).height, (*ptr).weight);

printf("Name = %s SSN = %s Age = %d Height(cm) = %g Weight(kg) = %g ", (&p1)- >name, (&p1)->ssn, (&p1)->age, (&p1)->height, (&p1)->weight);

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

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

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

Define semantics and give an example

Answered: 1 week ago

Question

Discuss the goals of financial management.

Answered: 1 week ago