write a program to swap Two numbers without using temp variable.
Answer Posted / ashish kumar sharma
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf("enter the Value of a:\n");
scanf("%d",&a);
printf("enter the Value of b:\n");
scanf("%d",&b);
a=a+b;
b=a-b;
a=a-b;
printf("Display The Swapping:\n");
printf("a=%d And b=%d",a,b);
getch();
}
Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What is the use of sizeof?
Can you return null in c?
The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?
What is the use of a semicolon (;) at the end of every program statement?
Should a function contain a return statement if it does not return a value?
How can I convert a number to a string?
What are different types of variables in c?
What are global variables?
write a program fibonacci series and palindrome program in c
a c code by using memory allocation for add ,multiply of sprase matrixes
what is a constant pointer in C
What are the 5 data types?
Write a C program that will accept a hexadecimal number as input and then display a menu that will permit any of the following operations to be carried out: Display the hexadecimal equivalent of the one's complement. (b) Carry out a masking operation and then display the hexadecimal equivalent of the result. (c) Carry out a bit shifting operation and then display the hexadecimal equivalent of the result. (d) Exit. If the masking operation is selected, prompt the user lor the type of operation (bitwise and, bitwise exclusive or, or bitwise or) and then a (hexadecimal) value for the mask. If the bit shifting operation is selected. prompt the user for the type of shift (left or right), and then the number of bits. Test the program with several different (hexadecimal) input values of your own choice.
Is c still used?
Under what circumstances does a name clash occur?