Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Antipatterns Avoiding The Pitfalls Of Database Programming

Authors: Bill Karwin

1st Edition

1680508989, 978-1680508987

More Books

Students also viewed these Databases questions