Question: Q1- Write a program to create an integer variable and a float variable, two pointes and use these pointers to point to the defined variables.

Q1- Write a program to create an integer variable and a float variable, two pointes and use these pointers to point to the defined variables.

Q2- Suppose you have the following memory image, where a, b are two integers variables and p is a pointer to int.

Determine the output of each print statement in the following

cout<< p<< endl;

p=&a;

*p=20;

cout<< p<< endl;

cout<< &p<< endl;

cout<< b<< endl;

p=&b;

cout<< p<< endl;

cout<< *p<< endl;

Q3- Write a program to create two pointers, one of type int and the other of type float and dynamically assign pointees for them.

Q4- Write a program to dynamically create an array of 10 float elements all initialized to zero.

Q5- using a for loop to assign values of {10, 5, 1.5, 6, 5.4, 8, 9.1, 2.3, 9.1, 3} to the array created in Q4.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!