C Program to Swap Two Numbers / Variables using Pointer
Accept two numbers from the user and swap the values of two integer variables using the pointer.
Accept two numbers from the user and swap the values of two integer variables using the pointer.
Stack operations can be implemented using the pointer in easy manner. This article will explain you everything about the stack using pointer.
In this program , base address of the array is stored inside the pointer variable and using pointer the sum of array element is computed.
C Program to Count - Vowels,Spaces,Words,Characters,Digits
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-6481c0dad270b664488201/] Output : [crayon-6481c0dad2711342477036/] 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 [...]
Write a C program using pointers to read in an array of integers and print its elements in reverse order. [crayon-6481c0dad2bd0211712529/] Output : [crayon-6481c0dad2bd7102923740/] Program to read integers into an array and reversing them using pointers Explanation : We have declared one pointer variable and one array. [crayon-6481c0dad2bda558657294/] Address of first element of array is stored inside pointer variable. [crayon-6481c0dad2bde885274651/] Accept Size of an Array. [crayon-6481c0dad2be1732731095/] Now we have accepted element one by one using for loop and scanf statement . [crayon-6481c0dad2be4852921096/] Increment pointer variable so that it will then point to [...]
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-6481c0dad2f57134413494/] Output : [crayon-6481c0dad2f5d034016089/] Note : Value Filed of Pointer Can Be Accessed Using '*' Operator '*' is value at Operator. Read '*ptr' as 'Value at Address ptr'.
Area of Circle can be computed using the pointer. We are passing the variables to function using pass by reference or address scheme and we are writing the result directly on the final memory location.
C Program will explain you how to Access Value and address of variable using Pointer
Access Address of Variable using Pointer