write a program to swap Two numbers without using temp variable.
Answer Posted / manas ranjan(gift)
#include<stdio.h>
void main()
{
int a,b;
printf("enter the numbers");
scanf("%d%d",&a,&b);
printf("before swaping the values are");
printf("a=%d,b=%d",a,b);
void swap(int,int);
swap(a,b);
}
void swap(int a,int b)
{
a=a+b;
b=a-b;
a=a-b;
printf("a=%d,b=%d",a,b);
}
| Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
how to find binary of number?
Why do we use stdio h and conio h?
With the help of using classes, write a program to add two numbers.
Explain what is the difference between the expression '++a' and 'a++'?
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler
What are header files in c programming?
Explain the priority queues?
Which operators cannot be overloaded a) Sizeof b) .* c) :: d) all of the above
write a program to concatenation the string using switch case?
Explain the use of 'auto' keyword
Why do we need arrays in c?
#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }
What is the g value paradox?
Write a program to use switch statement.
What is the use of getchar functions?