write a program to swap Two numbers without using temp variable.
Answer Posted / insane programmer
#include<stdio.h>
#include<conio.h>
void main()
{
int a=100, b=30;
clrscr();
a = a+b;
b = a-b;
a = a-b;
printf("Swapping without using third variable (using + and -).\n\n");
printf("Value of a=%d and b=%d.", a,b);
getch();
}
you can get more example here http://rajkishor09.hubpages.com/_eknow/hub/How-to-swap-two-numbers-without-using-third-temp-variable
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
How can I read in an object file and jump to locations in it?
How do you convert strings to numbers in C?
What do you mean by command line argument?
Can you please explain the difference between strcpy() and memcpy() function?
pierrot's divisor program using c or c++ code
How can I implement sets or arrays of bits?
Explain data types & how many data types supported by c?
What is the purpose of 'register' keyword?
write a c program for swapping two strings using pointer
What is the purpose of the statement: strcat (S2, S1)?
Explain Function Pointer?
What tq means in chat?
Is there a built-in function in C that can be used for sorting data?
Who developed c language?
Not all reserved words are written in lowercase. TRUE or FALSE?