Please fill in the blanks for C /* This program will ask the user to input the values. All code will be in main(). */ /*Task 3: Pointer-to-double*/ #include int main() { //Declare 2 double variables double d1, d2; __1__ __2__; //Declare 1 pointer-to-double pd __3__ = __4__; //point to first double d1 //Ask user for value of d1 printf("Enter value for d1 double variable :"); scanf("%lf", &(__5__)); //save to d1 using pointer pd //Printing d1 in 2 ways, round to 2 decimal places printf("Printing d1 using d1: __6__\n", __7__); printf("Printing d1 using pd: __8__\n", __9__); //Point pd to d2 __10__ = __11__; //Ask user for value of d2 printf("Enter value for d2 double variable :"); scanf("__12__", __13__(__14__)); //save to d2 using pointer pd //Printing d2 in 2 ways, round to 2 decimal places printf("Printing d2 using d2: __15__\n", __16__); printf("Printing d2 using pd: __17__\n", __18__); return 0; }
Please fill in the blanks for C
/* This program will ask the user to input the values. All code will be in main(). */
/*Task 3: Pointer-to-double*/
#include<stdio.h>
int main()
{
//Declare 2 double variables
double d1, d2;
__1__ __2__; //Declare 1 pointer-to-double pd
__3__ = __4__; //point to first double d1
//Ask user for value of d1
printf("Enter value for d1 double variable :");
scanf("%lf", &(__5__)); //save to d1 using pointer pd
//Printing d1 in 2 ways, round to 2 decimal places
printf("Printing d1 using d1: __6__\n", __7__);
printf("Printing d1 using pd: __8__\n", __9__);
//Point pd to d2
__10__ = __11__;
//Ask user for value of d2
printf("Enter value for d2 double variable :");
scanf("__12__", __13__(__14__)); //save to d2 using pointer pd
//Printing d2 in 2 ways, round to 2 decimal places
printf("Printing d2 using d2: __15__\n", __16__);
printf("Printing d2 using pd: __17__\n", __18__);
return 0;
}
Step by step
Solved in 2 steps