C Program to Add Two Numbers Using Pointers

C Program to add two numbers using pointers for beginners to implement pointers concept to understand how the pointer is working in c.

Pointer Definition in C Program

A pointer is a variable whose value is the address of another variable, that is the memory location’s direct address. 

A pointer, like any other variable or constant, must be declared before it can be used to store any variable address. 

A pointer is a variable that stores a memory address. The addresses of other variables or memory items are stored in pointers.

Pointers are also useful for a different type of parameter passing known as Pass By Address.

Return Statement in C

A return statement marks the end of a function’s execution and hands control back to the calling function. 

The calling function resumes execution at the point where the call was made. A return statement can give the calling function a value. 

The return statement returns control of the execution flow to the function that called it.

* Symbol in C

The * symbol is used to get the value of the variable pointed to by the pointer. If a pointer in C is assigned to NULL, it means it is pointing to nothing. The number of elements available between two pointers can be calculated by subtracting two pointers.

#include <stdio.h>
int main()
int pointer1, pointer2, *p, *q, sum;
printf("Enter Two Numbers\n");
scanf("%d%d", &pointer1, &pointer2);
p = &pointer1;
q = &pointer2;
sum = *p + *q;
printf("Sum of Two Numbers %d\n", sum);
return 0;


Enter Two Numbers
Sum of Two Numbers 49