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 ? | 6 Yes | 2 No |
Post New Answer View All Answers
Write a program to check prime number in c programming?
hello freinds next week my interview in reliance,nybody has an idea about it intervew questions..so tell
What is keyword in c?
How can I run c program?
Give differences between - new and malloc() , delete and free() ?
Is multithreading possible in c?
Why c language?
What is calloc() function?
Explain about block scope in c?
What is difference between array and structure in c?
Why void main is used in c?
What is null in c?
How to declare pointer variables?
Explain what are multidimensional arrays?
What is the -> in c?