(C PROGRAMMING ONLY) 1. Pointing Fingers by CodeChum Admin I am so mad at my brothers, they always point their fingers to me whenever mom gets angry ?   Now that I'm knowledgeable about pointers, I'm going to point all of my 5 fingers to them. Let's see who's tough now!     Instructions: In the code editor, you are provided with a main() function where the user is asked for 5 double numbers. 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 Enter4th number: 24 Enter 5th number: 21 23.2 10.0 800.0 24.0 21.0

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

(C PROGRAMMING ONLY)

1. Pointing Fingers
by CodeChum Admin

I am so mad at my brothers, they always point their fingers to me whenever mom gets angry ?

 

Now that I'm knowledgeable about pointers, I'm going to point all of my 5 fingers to them. Let's see who's tough now!

 

 

Instructions:

In the code editor, you are provided with a main() function where the user is asked for 5 double numbers.
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
Enter4th number: 24
Enter 5th number: 21
23.2 10.0 800.0 24.0 21.0

main.c
< > +C
scanf("%Lf", &b);
printf("Enter 3rd number: ");
scanf("%Lf", &c);
printf("Enter 4th number: ");
scanf("%lf", &d);
printf("Enter 5th number: ");
scanf("%lf", &e);
10
11
12
13
14
15
16
17
// TODO: Fill in the blanks
ptr1
ptr2
ptr3
ptr4
ptr5
18
19
20
21
22
23
24
25 -
printf(
"%. 1lf %.1lf %.1lf %.1lf %.1lf",
*ptr1, *ptr2, *ptr3,
26
27
*ptr4, *ptr5
28
);
29
30
return 0;
|||||
I| || || ||I
Transcribed Image Text:main.c < > +C scanf("%Lf", &b); printf("Enter 3rd number: "); scanf("%Lf", &c); printf("Enter 4th number: "); scanf("%lf", &d); printf("Enter 5th number: "); scanf("%lf", &e); 10 11 12 13 14 15 16 17 // TODO: Fill in the blanks ptr1 ptr2 ptr3 ptr4 ptr5 18 19 20 21 22 23 24 25 - printf( "%. 1lf %.1lf %.1lf %.1lf %.1lf", *ptr1, *ptr2, *ptr3, 26 27 *ptr4, *ptr5 28 ); 29 30 return 0; ||||| I| || || ||I
main.c
4. Fourth number
1 #include<stdio.h>
5. Fifth number
3 - int main(void) {
double a, b, c, d, e;
double *ptr1, *ptr2, *ptr3, *ptr4, *ptr5;
4
Output
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);
7
Enter 1st number: 23.2
8
9.
Enter 2nd number: 10.01
10
Enter 3rd - number: 800
11
Enter 4th number: 24
12
Enter 5th number: 21
13
23.2 10.0 800.0 24.0- 21.0
14
15
16
17
// TODO: Fill in the blanks
ptr1
18
19
Transcribed Image Text:main.c 4. Fourth number 1 #include<stdio.h> 5. Fifth number 3 - int main(void) { double a, b, c, d, e; double *ptr1, *ptr2, *ptr3, *ptr4, *ptr5; 4 Output 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); 7 Enter 1st number: 23.2 8 9. Enter 2nd number: 10.01 10 Enter 3rd - number: 800 11 Enter 4th number: 24 12 Enter 5th number: 21 13 23.2 10.0 800.0 24.0- 21.0 14 15 16 17 // TODO: Fill in the blanks ptr1 18 19
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY