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


Please Help Members By Posting Answers For Below Questions

Differentiate between full, complete & perfect binary trees.

675


A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream

671


Is c still relevant?

646


How we can insert comments in a c program?

634


How do you print an address?

750






Difference between MAC vs. IP Addressing

644


What is quick sort in c?

588


List the variables are used for writing doubly linked list program.

1626


how many key words availabel in c a) 28 b) 31 c) 32

635


What does struct node * mean?

603


Add Two Numbers Without Using the Addition Operator

357


Explain how can I remove the trailing spaces from a string?

627


Input is "rama loves rajesh and rajesh Loves rama also and rajesh wear gloves and bloves" To print output is count the numbers of times repeted the word love without case sensitive.

1597


How do you define CONSTANT in C?

655


in multiple branching construct "default" case is a) optional b) compulsarily c) it is not include in this construct d) none of the above

637