Write a program to add numbers given by the user through the use of pointers.
C Programming Language Pointer in C Language (Article) Pointer in C Language (Program)
23768Program:
#include int main() { int a,b,c; int *pa,*pb,*pc; pa=&a; pb=&b; pc=&c; printf("\n ENTER THE FIRST NUMBER:"); scanf("%d",pa); printf("\n ENTER THE SECOND NUMBER:"); scanf("%d",pb); *pc=*pa+*pb; printf("\n SUM IS %d",*pc); return 0; }
Output:
ENTER THE FIRST NUMBER:12 ENTER THE SECOND NUMBER:13 SUM IS 25
Explanation:
None
This Particular section is dedicated to Programs only. If you want learn more about C Programming Language. Then you can visit below links to get more depth on this subject.