write a program to swap Two numbers without using temp variable.
Answer Posted / ragini
#include<stdio.h>
#include<conio.h>
void swap(int a,int b);
void main()
{
int a,b;
swap(a,b);
printf("Enter the 2 nos");
scanf("%d%d",&a,&b);
}
void swap(int x,int y)
{
x=x*y;
y=x/y;
x=x/y;
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is #ifdef ? What is its application?
What are the advantages of c preprocessor?
A collection of functions,calls,subroutines or other data a) library b) header files c) set of files d) textfiles
Explain what will the preprocessor do for a program?
What is scanf () in c?
What is malloc calloc and realloc in c?
Which header file is essential for using strcmp function?
What are preprocessor directives in c?
Do string constants represent numerical values?
Can I use base-2 constants (something like 0b101010)? Is there a printf format for binary?
What is function prototype in c with example?
how to construct a simulator keeping the logical boolean gates in c
Is exit(status) truly equivalent to returning the same status from main?
What is the difference between union and anonymous union?
What are the 5 elements of structure?