write a program to swap two variables a=5 , b= 10 without
using third variable
Answer Posted / nagendra kumar
#include<stdio.h>
main(){
int a,b;
printf("Enter A value: ");
scanf("%d",&a);
printf("\nEnter B value: ");
scanf("%d",&b);
printf("\nThe value of A is:%d",a);
printf("\n The value of B is:%d",b);
a=a+b;
b=a-b;
a=a-b;
printf("\n The value of A is:%d",a);
printf("\n The value of B is:%d",b);
}
| Is This Answer Correct ? | 20 Yes | 4 No |
Post New Answer View All Answers
What does 1f stand for?
Is null always equal to 0(zero)?
Difference between Shallow copy and Deep copy?
Hai,I have done with my bachelor of commerce and planing to ms,please suggest me how to convince vo for shifting from commerce to computers. Visa on 8 DEC 2014 Npu university
Write a program in "C" to calculate the root of a quadratic equation ax^2+bx+c=0, where the value of a,b & c are known.
What do you mean by keywords in c?
What functions are used in dynamic memory allocation in c?
What is meant by type specifiers?
c program for searching a student details among 10 student details
How can I pad a string to a known length?
What is the purpose of realloc()?
What was noalias and what ever happened to it?
How are portions of a program disabled in demo versions?
What is the difference between the local variable and global variable in c?
What is declaration and definition in c?