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 is a null string in c?

585


What was noalias and what ever happened to it?

590


Can you explain the four storage classes in C?

642


What is unsigned int in c?

556


Describe how arrays can be passed to a user defined function

780






Is c++ based on c?

650


Tell me what is null pointer in c?

613


Differentiate fundamental data types and derived data types in C.

613


What is c method?

535


What is ctrl c called?

591


in ‘C’ language for Matrix Multiplication fails” Introspect the causes for its failure and write down the possible reasons for its failure.

7394


What are the characteristics of arrays in c?

611


How are Structure passing and returning implemented by the complier?

713


Why shouldn’t I start variable names with underscores?

623


What are the advantages and disadvantages of c language?

560