Please fill in the blanks from 13 to 58 for C /* This program will do some basic programming using pointers. All will be written in main.   Declare 2 integers and 2 floats and initialize them (no need for user inputs): i1,i2,f1,f2   Print all 4 variables’ */ /*Pointers Basic*/ #include int main() {             printf("------------------------------------------------------------------------------------------------------------\n");             printf("Note: Pointers' values should be the same as the address of the variable it points to.\n");             printf("\tThe de-reference values of the pointers should be the same as the value of the variable it points to.\n");             printf("\tPointer pi1 points to i1. Pointer pi2 points to i2. Pointer pf1 points to f1. Pointer pf2 points to f2.\n");             printf("\tWhen printing values for the floats using the variables themselves or through de-referencing pointers, \ remember to round them to 3 decimal places.\n");             printf("  ------------------------------------------------------------------------------------------------------------\n\n");               // Declare 2 ints and 2 floats             int i1, i2; //the integers             float f1, f2; // the floats               // Initialize all 4 variables             i1 = 3, i2 = -100;             f1 = 2.4564; f2 = -34.21234;               //Print all four variables' values             //Round the float to 3 decimal places             printf("\nPrinting values:\n");             printf("i1 = %d, i2 = %d, f1 = %.3f, f2 = %.3f.\n",  i1,  i2,  f1, f2);               //Print all four variables' addresses             printf("\nPrinting addresses:\n");             printf("i1's = __13__, i2's = __14__, f1's = __15__, f2's = __16__.\n", __17__, __18__, __19__, __20__);               //Declare 2 pointer-to-int and 2 pointer-to-float             // name 2 pointer-to-int pi1 and pi2             // name 2 pointer-to-float pf1 and pf2             __21__ __22__, __23__; //pointer-to-int pi1, pi2             __24__ __25__, __26__; //pointer-to-float pf1, pf2               //Initialize pointer-to-int pointers             __27__ = __28__; //first pointer-to-int points to i1             __29__ = __30__; //second int pointer points to i2               //Initialize pointer-to-float             __31__ = __32__; //first pointer-to-float points to f1             __33__ = __34__;//second float pointer points to f2               printf("\nPrinting pointers' addresses:\n");             printf("pi1's = __35__, pi2's = __36__, pf1's = __37__, pf2's = __38__.\n", __39__, __40__, __41__, __42__);               printf("\nPrinting pointers' values:\n");             printf("pi1's = __43__, pi2's = __44__, pf1's = __45__, pf2's = __46__.\n", __47__, __48__, __49__, __50__);               printf("\nPrinting pointers' de-reference values:\n");             printf("de-ref pi1 = __51__, de-ref pi2  = __52__, de-ref pf1  = __53__, de-ref pf2 = __54__.\n",__55__, __56__, __57__, __58__);               return 0; }

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

Please fill in the blanks from 13 to 58 for C

/* This program will do some basic programming using pointers. All will be written in main.
  Declare 2 integers and 2 floats and initialize them (no need for user inputs): i1,i2,f1,f2
  Print all 4 variables’ */

/*Pointers Basic*/

#include<stdio.h>

int main()

{

            printf("------------------------------------------------------------------------------------------------------------\n");

            printf("Note: Pointers' values should be the same as the address of the variable it points to.\n");

            printf("\tThe de-reference values of the pointers should be the same as the value of the variable it points to.\n");

            printf("\tPointer pi1 points to i1. Pointer pi2 points to i2. Pointer pf1 points to f1. Pointer pf2 points to f2.\n");

            printf("\tWhen printing values for the floats using the variables themselves or through de-referencing pointers, \

remember to round them to 3 decimal places.\n");

            printf("  ------------------------------------------------------------------------------------------------------------\n\n");

 

            // Declare 2 ints and 2 floats

            int i1, i2; //the integers

            float f1, f2; // the floats

 

            // Initialize all 4 variables

            i1 = 3, i2 = -100;

            f1 = 2.4564; f2 = -34.21234;

 

            //Print all four variables' values

            //Round the float to 3 decimal places

            printf("\nPrinting values:\n");

            printf("i1 = %d, i2 = %d, f1 = %.3f, f2 = %.3f.\n",  i1,  i2,  f1, f2);

 

            //Print all four variables' addresses

            printf("\nPrinting addresses:\n");

            printf("i1's = __13__, i2's = __14__, f1's = __15__, f2's = __16__.\n", __17__, __18__, __19__, __20__);

 

            //Declare 2 pointer-to-int and 2 pointer-to-float

            // name 2 pointer-to-int pi1 and pi2

            // name 2 pointer-to-float pf1 and pf2

            __21__ __22__, __23__; //pointer-to-int pi1, pi2

            __24__ __25__, __26__; //pointer-to-float pf1, pf2

 

            //Initialize pointer-to-int pointers

            __27__ = __28__; //first pointer-to-int points to i1

            __29__ = __30__; //second int pointer points to i2

 

            //Initialize pointer-to-float

            __31__ = __32__; //first pointer-to-float points to f1

            __33__ = __34__;//second float pointer points to f2

 

            printf("\nPrinting pointers' addresses:\n");

            printf("pi1's = __35__, pi2's = __36__, pf1's = __37__, pf2's = __38__.\n", __39__, __40__, __41__, __42__);

 

            printf("\nPrinting pointers' values:\n");

            printf("pi1's = __43__, pi2's = __44__, pf1's = __45__, pf2's = __46__.\n", __47__, __48__, __49__, __50__);

 

            printf("\nPrinting pointers' de-reference values:\n");

            printf("de-ref pi1 = __51__, de-ref pi2  = __52__, de-ref pf1  = __53__, de-ref pf2 = __54__.\n",__55__, __56__, __57__, __58__);

 

            return 0;

}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 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