Question: Write the following program in c Assume the following variables have been declared as shown. double number1 = 7.3, number2; char s1[100], s2[100]; 1.

Write the following program in c

 

Assume the following variables have been declared as shown.

double number1 = 7.3, number2;

char s1[100], s2[100];

1. Declare the variable dPtr to be a pointer to a variable of type double.

2. Assign the address of variable number1 to pointer variable dPtr.

3. Print the value of the variable pointed to by dPtr to the display.

4. Assign the value of the variable pointed to by dPtr to variable number2.

5. Print the value of number2 to the display.

6. Print the address of number1 to the display.

7. Print the address stored in dPtr to the display.

8. Copy the string stored in character array s1 into character array s2.

9. Compare the string stored in character array s1 with the string in character array s2, and print the result to the display.

10. Determine the length of the string stored in character array s1, and print the result to the display.

11. Declare the variable ddPtr to be a pointer to a pointer of variable of type double.

12. Assign the address of variable dPtr to pointer variable ddPtr.

13. Print the value of the variable pointed to by ddPtr to the display.

14. Change the value of number1 using ddPtr.

15. Change the value of dPtr to point to number2 using ddPtr.

Step by Step Solution

3.44 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

c include include int main double number1 73 number2 char s1100 s2100 1 Declare the variable dPtr to ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!