write a program to swap Two numbers without using temp variable.

Answer Posted / tchoephel

#include<stdio.h>
#include<conio.h>
void main()
{

int a,b;
printf("enter two nos A and B\n");
scanf("%d%d",a,b);
printf("before swaping A=%d\n B=%d\n",a,b);
a=a+b:
b=a-b;
a=a-b;
prinf("after swaping A=%d\n B=%d\n",a,b);
getch();
}

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a pointer value and address in c?

811


What is the use of c language in real life?

763


How is a null pointer different from a dangling pointer?

770


all c language question

2160


What is the meaning of && in c?

740


What is indirection in c?

795


What is function definition in c?

776


Is sizeof a keyword in c?

753


Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

1121


What does 4d mean in c?

1209


How do you define CONSTANT in C?

870


what is a constant pointer in C

875


write a c program to print the next of a particular no without using the arithmetic operator or looping statements?

3503


How are Structure passing and returning implemented by the complier?

914


What is p in text message?

728