#include<stdio.h> int main() { int x,y; printf(" ***PROGRAM TO ADD TWO NUMBERS WITHOUT USING THIRD VARIABLE*** "); printf("\n Enter the first number to be added: "); scanf("%d",&x); /* taking x value from keyboard*/ printf("\n Enter the second number to be added: "); scanf("%d",&y); /* taking y value from keyboard*/ x = x + y; /*assining the value of sum of x and y to x*/ printf("\n The sum of two numbers is: %d\n",x); /*printing the sum.*/ return 0; }Sample Output:
a blog by Sameer. Its all about programming and technology. Articles on C programs, C#.Net, VB.Net, ASP.Net, Sql Sever, Technology and many more.
This website completely moved to new platform. For latest content, visit www.programmingposts.com
Search this Site
22 Jul 2013
C PROGRAM TO ADD TWO NUMBERS WITHOUT USING THIRD VARIABLE
RELATED POSTS
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Thanks for your comments.
-Sameer