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);
printf("\n The value of A is:%d",a);
printf("\n The value of B is:%d",b);
}
| Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What is the mean of function?
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
write a program for the normal snake games find in most of the mobiles.
What do you mean by dynamic memory allocation in c? What functions are used?
difference between Low, Middle, High Level languages in c ?
What is function what are the types of function?
How can I implement a delay, or time a users response, with sub-second resolution?
Not all reserved words are written in lowercase. TRUE or FALSE?
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above
write a program to find the given number is prime or not
What is oops c?
how to solve "unable to open stdio.h and conio.h header files in windows 7 by using Dos-box software
What is typedf?
write a program which the o/p should b in such a way that s triangle if I/p is 3,a Square/rectangle if I/P=4,a pentagon if I/P=5 and so on...forget about the I/P which is less than 3
List the difference between a While & Do While loops?