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

Answer Posted / dally

#include<stdio.h>
int main()
{
int a,b;
printf("Enter values for a,b\n");
scanf("%d %d",&a,&b);

b = b+a;
a= b-a;
b=b-a;
printf("a = %d,b = %d",a,b);

}

Is This Answer Correct ?    18 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain c preprocessor?

671


What is the scope of static variable in c?

519


What are the types of unary operators?

647


write a program for the normal snake games find in most of the mobiles.

1773


What are the advantages of the functions?

600






What is pragma in c?

616


What is the sizeof () operator?

610


What are c identifiers?

615


How can I call a function with an argument list built up at run time?

621


What is the description for syntax errors?

604


What are data structures in c and how to use them?

662


Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?

590


what is event driven software and what is procedural driven software?

2001


What does 3 periods mean in texting?

585


What is .obj file in c?

638