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 ? | 19 Yes | 4 No |
Post New Answer View All Answers
Define circular linked list.
How can you check to see whether a symbol is defined?
What is the use of #include in c?
How do we declare variables in c?
Write the control statements in C language
Is c language still used?
What is the difference between printf and scanf in c?
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
What is 1f in c?
What is structure padding in c?
What is the use of header files?
What is the right way to use errno?
Who is the founder of c language?
praagnovation
What are the advantages and disadvantages of c language?