a C prog to swap 2 no.s without using variables just an
array?
Answer Posted / baidyanath bisoyi
void main()
{
int a,b;
printf("enter the two numbers\n");
scanf("%d%d",&a,&b);
printf("a=%d\n b=%d\n",a,b);
a=a+b-(b=a);
printf("a=%d\n b=%d\n",a,b);
getch();
}
| Is This Answer Correct ? | 4 Yes | 3 No |
Post New Answer View All Answers
Do variables need to be initialized?
How can I display a percentage-done indication that updates itself in place, or show one of those twirling baton progress indicators?
Explain what is dynamic data structure?
What is string length in c?
How can I open a file so that other programs can update it at the same time?
What is difference between main and void main?
Can a function argument have default value?
How many levels of indirection in pointers can you have in a single declaration?
What are the advantage of c language?
What does volatile do?
What is a union?
Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.
Where does the name "C" come from, anyway?
Why c is called free form language?
What is difference between structure and union in c?