write a program to swap Two numbers without using temp variable.
Answer Posted / sree
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("Enter two numbers");
scanf("%d %d",&a &b);
a=a+b;
b=a-b;
a=a-b;
printf("The swapped values are:");
printf("a:%d",a);
printf("b:%d",b);
getch();
}
Is This Answer Correct ? | 73 Yes | 24 No |
Post New Answer View All Answers
What is an expression?
a sequence of bytes with one to one corrspondence to those in the external device a) sequential addressing b) address c) byte code d) none
What is storage class?
If errno contains a nonzero number, is there an error?
Is c easier than java?
Can we use any name in place of argv and argc as command line arguments?
Explain what will the preprocessor do for a program?
How can you find the day of the week given the date?
Difference between malloc() and calloc() function?
What are the different types of C instructions?
What is variables in c?
How do I get an accurate error status return from system on ms-dos?
What is the use of sizeof?
Which control loop is recommended if you have to execute set of statements for fixed number of times?
What are # preprocessor operator in c?