#include<stdio.h> main() { int num1,num2; printf("Enter number 1 : "); scanf("%d",&num1); printf("Enter number 2 : "); scanf("%d",&num2); printf("Before swapping\n"); printf("number 1 is %d and number 2 is %d\n",num1,num2); num1=num1+num2; num2=num1-num2; num1=num1-num2; printf("After swapping \n"); printf("number 1 is %d and number 2 is %d\n",num1,num2); }
New Android apps UniqueKey
Friday, 20 February 2015
Swapping without temp variable
Labels:
C language
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment