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

Answer Posted / guest

# include "stdio.h"
main()
{
int a,b;
printf("enter two numbers for swaping");
scanf("%d%d",&a,&b);
a=a+b;
b=a-b;
a=a-b;
printf("a is %d",a);
printf("b is %d",b);
} output:- takea,b value is 2,3 and give answers is3,2

Is This Answer Correct ?    243 Yes 58 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are called c variables?

745


What is operator precedence?

852


What do the functions atoi(), itoa() and gcvt() do?

892


What is formal argument?

854


what is use of malloc and calloc?

1609






What is a pointer variable in c language?

816


given post order,in order construct the corresponding binary tree

2517


How can I implement sets or arrays of bits?

790


Is c is a low level language?

759


Explain b+ tree?

814


what are enumerations in C

904


How do you construct an increment statement or decrement statement in C?

974


Explain the difference between call by value and call by reference in c language?

843


Write a code to remove duplicates in a string.

806


In c programming language, how many parameters can be passed to a function ?

840