write a program to swap Two numbers without using temp variable.

Answer Posted / riyaz

int a, b;

printf("a=");
scanf("%d",&a);
printf("b=");
scanf("%d",&b);


printf("a = %d\nb = %d\n",b,a);
return 0;

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is #define?

569


Explain modulus operator.

588


What are all different types of pointers in c?

568


Why flag is used in c?

646


what does static variable mean?

643






Why pointers are used in c?

576


Write a program for Overriding.

672


How can I list all of the predefined identifiers?

570


What is union in c?

626


if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0

1434


What is volatile variable in c with example?

579


What was noalias and what ever happened to it?

586


What are the differences between Structures and Arrays?

599


What is new line escape sequence?

798


Do you have any idea about the use of "auto" keyword?

656