1. In the code editor, you are provided with a main() function where the user is asked for 5 double numbers. 2. Then, in lines 19 - 23, your task is to set the addresses of these numbers to each of the pointers. The address of the first number, a, should be assigned to the first pointer, the address of the second number, b, should be assigned to the second pointer, and so on.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

hello! can you please help me with my code? i need to get the same expected output. the instructions are on the photo as well as the expected output


here's my code:

#include<stdio.h>

int main(void) {
    double a, b, c, d, e;
    double *ptr1, *ptr2, *ptr3, *ptr4, *ptr5;

    printf("Enter 1st number: ");
    scanf("%lf", &a);
    printf("Enter 2nd number: ");
    scanf("%lf", &b);
    printf("Enter 3rd number: ");
    scanf("%lf", &c);
    printf("Enter 4th number: ");
    scanf("%lf", &d);
    printf("Enter 5th number: ");
    scanf("%lf", &e);

    // TODO: Fill in the blanks
    ptr1 = __
    ptr2 = __
    ptr3 = __ 
    ptr4 = __ 
    ptr5 = __

    printf(
        "%.1lf %.1lf %.1lf %.1lf %.1lf",
        *ptr1, *ptr2, *ptr3, *ptr4, *ptr5
    );

    return 0;
}

Instructions:
1. In the code editor, you are provided with a main() function
where the user is asked for 5 double numbers.
2. Then, in lines 19 - 23, your task is to set the addresses of
these numbers to each of the pointers. The address of the
first number, a, should be assigned to the first pointer, the
address of the second number, b, should be assigned to the
second pointer, and so on.
Input
1. First number
2. Second number
3. Third number
4. Fourth number
5. Fifth number
Output
Enter 1st number: 23.2
Enter 2nd number: 10.01
Enter 3rd number: 800
Enter 4th number: 24
Enter 5th number: 21
23.2 10.e 8ee.0 24.0 21.0
Transcribed Image Text:Instructions: 1. In the code editor, you are provided with a main() function where the user is asked for 5 double numbers. 2. Then, in lines 19 - 23, your task is to set the addresses of these numbers to each of the pointers. The address of the first number, a, should be assigned to the first pointer, the address of the second number, b, should be assigned to the second pointer, and so on. Input 1. First number 2. Second number 3. Third number 4. Fourth number 5. Fifth number Output Enter 1st number: 23.2 Enter 2nd number: 10.01 Enter 3rd number: 800 Enter 4th number: 24 Enter 5th number: 21 23.2 10.e 8ee.0 24.0 21.0
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Concept of pointer parameter
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education