Write a program to exchange two variaables without temp

Answer Posted / srinivas

main()
{
int a=3,b=2;

a = (a+b)-(b=a);

printf("a=%d,b=%d",a,b);
}
o/p:- a=2,b=3

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does typedef struct mean?

662


List some of the static data structures in C?

762


Can you write a programmer for FACTORIAL using recursion?

614


What are the types of c language?

557


What do you mean by scope of a variable in c?

544






What is variable in c example?

594


When should I declare a function?

623


What is void main ()?

611


What is a pointer variable in c language?

645


How do you use a 'Local Block'?

723


Explain what is the difference between null and nul?

658


What is the difference between abs() and fabs() functions?

607


how to make a scientific calculater ?

1565


What is modifier & how many types of modifiers available in c?

612


What is spark map function?

581