write a program to swap Two numbers without using temp variable.
Answer Posted / romeld
#include<stdio.h>
main()
{
int a,b;
printf("enter the value of a and b\n");
scanf("%d%d",&a,&b);
printf("before swapping\na=%d\nb=%d\n",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("after swapping\na=%d\nb=%d\n",a,b);
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are the loops in c?
Explain how can I write functions that take a variable number of arguments?
When should volatile modifier be used?
any "C" function by default returns an a) int value b) float value c) char value d) a & b
What is #define used for in c?
What is define directive?
What does c mean before a date?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above
What does c mean?
What is a nested formula?
What are the different types of errors?
When should you use a type cast?
Tell me the use of bit field in c language?
A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM
we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?