write a program to swap two variables a=5 , b= 10 without
using third variable
Answer Posted / dhanalakshmi
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("enter the a value"));
scanf("%d",&a);//a=10
printf("enter the b value");
scanf("%d",&b);//b=5
b=b+a;
a=b-a;
b=b-a;
printf("\n The value of A is:%d",a);
printf("\n The value of B is:%d",b);
}
| Is This Answer Correct ? | 7 Yes | 2 No |
Post New Answer View All Answers
List some applications of c programming language?
Multiply an Integer Number by 2 Without Using Multiplication Operator
What are pointers? What are different types of pointers?
With the help of using classes, write a program to add two numbers.
What does double pointer mean in c?
What does int main () mean?
What is the maximum no. of arguments that can be given in a command line in C.?
What is #include stdio h?
What is structure data type in c?
Explain how can you be sure that a program follows the ansi c standard?
Why c language?
provide an example of the Group by clause, when would you use this clause
What is the scope of an external variable in c?
Write a program to check palindrome number in c programming?
if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.