9. (B) Write a program to perform addition and subtraction of two pointer variables.
#include <stdio.h> | |
int main() | |
{ | |
int first, second, *p, *q, sum; | |
printf("Enter two integers to add\n"); | |
scanf("%d%d", &first, &second); | |
p = &first; | |
q = &second; | |
sum = *p + *q; | |
printf("Sum of entered numbers = %d\n",sum); | |
return 0; | |
} |
9. (B) Write a program to perform addition and subtraction of two pointer variables.
Reviewed by admin
on
December 23, 2019
Rating:

No comments: