write a program to swap Two numbers without using temp variable.
Answer Posted / ravi saini
void main()
{
int a,b;
printf("enter the two numbers");
scanf("%d%d",&a,&b);
a^=b^=a^=b;
printf("%d%d",a,b);//swapped no
}
| Is This Answer Correct ? | 119 Yes | 66 No |
Post New Answer View All Answers
What are header files why are they important?
What is a program flowchart and explain how does it help in writing a program?
Array is an lvalue or not?
When should the const modifier be used?
In C programming, what command or code can be used to determine if a number of odd or even?
Write a program to check prime number in c programming?
What is bubble sort in c?
the factorial of non-negative integer n is written n! and is defined as follows: n!=n*(n-1)*(n-2)........1(for values of n greater than or equal to 1 and n!=1(for n=0) Perform the following 1.write a c program that reads a non-negative integer and computes and prints its factorial. 2. write a C program that estimates the value of the mathematical constant e by using the formula: e=1+1/!+1/2!+1/3!+.... 3. write a c program the computes the value ex by using the formula ex=1+x/1!+xsquare/2!+xcube/3!+....
How a string is stored in c?
a value that does not change during program execution a) variabe b) argument c) parameter d) none
What is the right type to use for boolean values in c? Is there a standard type?
What is the meaning of typedef struct in c?
How can I automatically locate a programs configuration files in the same directory as the executable?
Who invented bcpl language?
Which are low level languages?