C Program to Find Length of the String using Pointer

Program to Calculate Length of the String using Pointer Write a C Program which will accept string from the user . Pass this string to the function. Calculate the length of the string using pointer. Program : Length of the String using Pointer [crayon-581eaf01e0a67930148460/] Output : [crayon-581eaf01e0a7a579359535/] Explanation :gets() is used to accept string with spaces. we are passing accepted string to the function. Inside function we have stored this string in pointer. (i.e base of the string is stored inside pointer variable). Inside while loop we are [...]

C Program to Read integers into an array and Reversing them using Pointers

Write a C program using pointers to read in an array of integers and print its elements in reverse order. [crayon-581eaf01e11b1098309539/] Output : [crayon-581eaf01e11c3055035803/] Program to read integers into an array and reversing them using pointers Explanation :We have declared one pointer variable and one array.[crayon-581eaf01e11d1417338793/]Address of first element of array is stored inside pointer variable.[crayon-581eaf01e11de731533924/]Accept Size of an Array.[crayon-581eaf01e11ea157494926/]Now we have accepted element one by one using for loop and scanf statement .[crayon-581eaf01e11f6747005527/]Increment pointer variable so that it will then point to [...]

C Program to Add Two Numbers Using Pointer !

Program : How to Add Two Numbers Using Pointer ? In this program we are going to accept two numbers from user using pointer. After accepting two numbers we are going to add two numbers by using de-reference operator in Pointer. [crayon-581eaf01e1d46785561057/]Output : [crayon-581eaf01e1d57651838004/] Note :Value Filed of Pointer Can Be Accessed Using '*' Operator '*' is value at Operator. Read '*ptr' as 'Value at Address ptr'.