Q:

C Program to add two numbers using pointers

0

C Program to add two numbers using pointers

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#include <stdio.h>
int main()
{
   int fno, sno, *ptr, *qtr, sum;
   
   printf("\n\n Pointer : Add two numbers :\n"); 
   printf("--------------------------------\n");   
 
   printf(" Input the first number : ");
   scanf("%d", &fno);
   printf(" Input the second  number : ");
   scanf("%d", &sno);   
 
   ptr = &fno;
   qtr = &sno;
 
   sum = *ptr + *qtr;
 
   printf(" The sum of the entered numbers is : %d\n\n",sum);
 
   return 0;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now