#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int num1, num2, *ptr1, *ptr2, sum=0;
printf("Enter the two number :");
scanf("%d%d",&num1,&num2);
ptr1 = &num1;
ptr2 = &num2;
sum = *ptr1 + *ptr2;
printf("Sum of the two number is %d",sum);
getch();
}
C program for addition of 2 numbers using pointers.
Reviewed by
on
December 22, 2019
Rating: 5
No comments: