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 is a null pointer different from a dangling pointer?
What is wrong in this statement?
What is "Duff's Device"?
What is meant by operator precedence?
Here is a neat trick for checking whether two strings are equal
How many types of arrays are there in c?
Explain the use of fflush() function?
Tell me is null always defined as 0(zero)?
What is structure data type in c?
Write a program of advanced Fibonacci series.
Write a program, where i have a grid with many cells, how many paths are possible from one point to other desired points.
How do you generate random numbers in C?
What is far pointer in c?
How do I use void main?
What’s a signal? Explain what do I use signals for?