C Books Guide and List
C++ Books Guide and List
Best Java Books

3,749 questions

4,049 answers

114 comments

10,705 users

Write a C program to add two numbers through variables and their pointers?

0 votes
32 views
asked Jan 7, 2014 by smith Geek (15,340 points)

1 Answer

0 votes

#include<stdio.h>

#include<conio.h>

void main()

{

int a,b,c,d,*ap,*bp;

clrscr();

printf(“Enter two numbers:”);

scanf(“%d%d”, &a,&b);

ap=&a;

bp=&b;

c=a+b;

d=*ap+*bp;

printf(“\n sum of A &B using variable:%d”,c);

printf(“\n sum of A &B using pointer:%d”,d);

getch();

}

Output:

Enter two numbers: 8 4

Sum of a & B using variable:12

Sum of a & B using pointer:12 

answered Jan 7, 2014 by rajesh Guru (39,140 points)

Related questions

0 votes
1 answer 17 views
0 votes
1 answer 776 views
0 votes
1 answer 452 views
0 votes
1 answer 33,439 views
...