5. The ‘&’ and ‘*’ 3 ab 1000 Location name Value at Location Address
6.
7.
8.
9.
10. Write a program that computes the area and perimeter of a rectangle: #include <stdio.h> void rectangle(int a, int b, int * area, int * perim); int main() { int x, y; int area, perim; printf("Enter two values separated by space: " ); scanf("%d %d", &x, &y); rectangle(x, y, &area, &perim); printf("Area is %d Perimeter is %d", area, perim); return 0; } void rectangle(int a,int b,int * area,int * perim) { *area = a * b; *perim = 2 * (a + b); }
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21. Arrays of Pointers 1000 2500 2000 1500 i 5 10 j 20 15 l k 2500 2000 1500 1000 arr[0] arr[3] arr[2] arr[1] 1200 2700 2200 1700
25. Double Pointer OUTPUT: Address of i is 1000 1000 1000 Address of j is 2000 2000 Address of k is 3000 Value of i is 3 3 3 3 Value of j is 1000 Value of k is 2000