Solution: Like malloc, calloc also allocates memory at runtime and is defined in stdlib.h. It takes the number of elements and the size of each element(in bytes), initializes each element to zero and then returns …
Solution: In this program, we used malloc() function to allocate the memory. After memory allocation, we read the elements into array using for loop with expression “p+i”. Using pointer variable “p” and it’s increment, we …
Solution: In this program, we define a function add() that returns the address of variable ‘z’. ‘z’ holds the value which is sum of 2 input number x and y. To collect the address returned …
Solution: Swapping is the concept of interchanging the values of 2 numbers. We use call by reference concept to swap 2 numbers in this code. Read elements into variables a and b in main() function …