can you help me get the expected output like what's on the photo. below is my source code in basic c language   #include typedef struct {     int age; } Person; void displayPerson(Person); int main(void) {     // TODO: Create a Person here and ask the user for its age     return 0; } void displayPerson(Person p) {     printf("PERSON DETAILS:\n");     printf("Age: %d", p.age); }

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter6: Sub And Function Procedures
Section: Chapter Questions
Problem 2MQ2
icon
Related questions
Question

can you help me get the expected output like what's on the photo. below is my source code in basic c language

 

#include<stdio.h>

typedef struct {
    int age;
} Person;

void displayPerson(Person);

int main(void) {
    // TODO: Create a Person here and ask the user for its age

    return 0;
}

void displayPerson(Person p) {
    printf("PERSON DETAILS:\n");
    printf("Age: %d", p.age);
}

Instructions:
1. In the code editor, you are provided with the definition of a
struct Person. This struct needs an integer value for its age.
Furthermore, you are provided with a displayPerson()
function which accepts a struct Person as its parameter.
2. Your task is to create a Person, take in an integer user input,
and then set it as the Person's age.
3. Finally, call the displayPerson () function and pass that
Person you created.
Input
1. The age of the Person
Output
Enter Person's age: 24
PERSON DETAILS:
Age: 24
Transcribed Image Text:Instructions: 1. In the code editor, you are provided with the definition of a struct Person. This struct needs an integer value for its age. Furthermore, you are provided with a displayPerson() function which accepts a struct Person as its parameter. 2. Your task is to create a Person, take in an integer user input, and then set it as the Person's age. 3. Finally, call the displayPerson () function and pass that Person you created. Input 1. The age of the Person Output Enter Person's age: 24 PERSON DETAILS: Age: 24
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Reference Types in Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,