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

Answer Posted / ankit tiwari

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("enter the two number");
scanf("%d%d",&a,&b);
a=b-a;
b=b-a;
a=b+a;
printf("ais=%d",a);
printf("b is=%d",b);
getch();
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can I find the modification date and time of a file?

596


Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)

5784


Write a program to print fibonacci series using recursion?

580


What is the difference between local variable and global variable in c?

677


What is the purpose of void in c?

609






What are the different types of pointers used in c language?

608


What is the use of typedef in c?

577


What are derived data types in c?

602


What is static memory allocation?

597


What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?

719


c programs are converted into machine language with the help of a) an interpreter b) a compiler c) an operatinf system d) none of the above

725


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

757


Is c language still used?

530


What is pointer to pointer in c language?

585


All technical questions

1501