main.c I am so mad at my brothers, they always point their fingers to me whenever mom gets angry ? 1 #include 2 3 int main(void) { double a, b, c, d, e; double *ptr1, *ptr2, *ptr3, *ptr4, *ptr5; 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! 4 5. 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 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 10 11 12 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 13 14 on. 15 16 17 18 // TODO: Fill in the blanks Input ptri = ptr2 = ptr3 = ptr4 = ptr5 = 19 1. First number 20 21 2. Second number 22 23 3. Third number 24 printf( "%.1lf %.1lf %.11f %.1lf %.11f", *ptr1, *ptr2, *ptr3, *ptr4, *ptr5 ); 25 4. Fourth number 26 27 28

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

Programming: C language

< > + c
on.
main.c
1 #include<stdio.h>
Input
2
3 int main(void) {
double a, b, с, d, e;
double *ptr1, *ptr2, *ptr3, *ptr4, *ptr5;
1. First number
4
2. Second number
6
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("%1f", &d);
printf("Enter 5th number: ");
scanf("%lf", &e);
7
3. Third number
8
4. Fourth number
10
5. Fifth number
11
12
13
Output
14
15
16
Enter 1st number: 23.2
17
Enter 2nd number: 10.01
18
// TODO: Fill in the blanks
19
ptr1 =
ptr2
ptr3 =
ptr4 =
ptr5 =
Enter 3rd number: 800
20
Enter 4th number: 24
21
Enter 5th number: 21
22
23.2. 10.0.800.0 24.0 21.0
23
24
printf(
"%.11f %.11lf %.1lf %.1lf %.1lf",
*ptr1, *ptr2, *ptr3, *ptr4, *ptr5
);
25
26
27
28
29
30
return 0;
Transcribed Image Text:< > + c on. main.c 1 #include<stdio.h> Input 2 3 int main(void) { double a, b, с, d, e; double *ptr1, *ptr2, *ptr3, *ptr4, *ptr5; 1. First number 4 2. Second number 6 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("%1f", &d); printf("Enter 5th number: "); scanf("%lf", &e); 7 3. Third number 8 4. Fourth number 10 5. Fifth number 11 12 13 Output 14 15 16 Enter 1st number: 23.2 17 Enter 2nd number: 10.01 18 // TODO: Fill in the blanks 19 ptr1 = ptr2 ptr3 = ptr4 = ptr5 = Enter 3rd number: 800 20 Enter 4th number: 24 21 Enter 5th number: 21 22 23.2. 10.0.800.0 24.0 21.0 23 24 printf( "%.11f %.11lf %.1lf %.1lf %.1lf", *ptr1, *ptr2, *ptr3, *ptr4, *ptr5 ); 25 26 27 28 29 30 return 0;
I am so mad at my brothers, they always point their fingers to me whenever mom gets angry
main.c
< > + C
?
1 #include<stdio.h>
2
Now that I'm knowledgeable about pointers, I'm going to point all of my 5 fingers to them.
3 int main(void) {
Let's see who's tough now!
double a, b, c, d, e;
double *ptr1, *ptr2, *ptr3, *ptr4, *ptr5;
4
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
Instructions:
8.
1. In the code editor, you are provided with a main() function where the user is asked for
10
5 double numbers.
11
2. Then, in lines 19 - 23, your task is to set the addresses of these numbers to each of
12
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
13
14
on.
15
16
17
// TODO: Fill in the blanks
ptr1 =
ptr2 =
ptr3 =
ptr4 =
ptr5 =
18
Input
19
20
1. First number
21
2. Second number
22
23
%3D
3. Third number
24
printf(
"%.11f %.11f %.1lf %.11f %.1lf",
*ptr1, *ptr2, *ptr3, *ptr4, *ptr5
);
25
4. Fourth number
26
27
28
29
30
return 0;
Transcribed Image Text:I am so mad at my brothers, they always point their fingers to me whenever mom gets angry main.c < > + C ? 1 #include<stdio.h> 2 Now that I'm knowledgeable about pointers, I'm going to point all of my 5 fingers to them. 3 int main(void) { Let's see who's tough now! double a, b, c, d, e; double *ptr1, *ptr2, *ptr3, *ptr4, *ptr5; 4 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 Instructions: 8. 1. In the code editor, you are provided with a main() function where the user is asked for 10 5 double numbers. 11 2. Then, in lines 19 - 23, your task is to set the addresses of these numbers to each of 12 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 13 14 on. 15 16 17 // TODO: Fill in the blanks ptr1 = ptr2 = ptr3 = ptr4 = ptr5 = 18 Input 19 20 1. First number 21 2. Second number 22 23 %3D 3. Third number 24 printf( "%.11f %.11f %.1lf %.11f %.1lf", *ptr1, *ptr2, *ptr3, *ptr4, *ptr5 ); 25 4. Fourth number 26 27 28 29 30 return 0;
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
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
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