write a program to swap Two numbers without using temp variable.
Answer Posted / harisharumalla
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("\n Enter the 2 numbers");
scanf("%d%d",&a,&b);
//swaping of 2 numbers without using temp variable
a=a+b;
b=a-b;
a=a-b;
/* or
a=a*b;
b=a/b;
a=a/b;
*/
printf("\n A = %d \n B = %d\n");
getch();
}
| Is This Answer Correct ? | 604 Yes | 119 No |
Post New Answer View All Answers
FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above
Can stdout be forced to print somewhere other than the screen?
What is the maximum length of an identifier?
What is function prototype in c with example?
a c code by using memory allocation for add ,multiply of sprase matrixes
Write a program of advanced Fibonacci series.
what is the diffrenet bettwen HTTP and internet protocol
What is a structure member in c?
What are the advantages of the functions?
Is array name a pointer?
what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values
write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?
Can two or more operators such as and be combined in a single line of program code?
Is file a keyword in c?
1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures