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

Answer Posted / gouttam pradhan

#include<stdio.h>
main()
{
int a,b;
printf("enter two numbers");
scanf("%d%d",&a&b);
a=a+b;
b=a-b;
a=a-b;
printf("swaped valuess= ",);
printf("a=%d",a);
printf("b=%d",b);
getch();
}

Is This Answer Correct ?    6 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Define Array of pointers.

621


Why does the call char scanf work?

607


What is the purpose of 'register' keyword in c language?

611


Write a program to print fibonacci series using recursion?

575


Is c programming hard?

563






What does printf does?

724


Can you return null in c?

586


What is #ifdef ? What is its application?

635


Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix

1505


Where are some collections of useful code fragments and examples?

701


What are the advantages of c language?

655


C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

599


Write a code to generate a series where the next element is the sum of last k terms.

719


What is the difference between %d and %i?

581


What are reserved words with a programming language?

586