write a program to swap Two numbers without using temp variable.
Answer Posted / ram thilak.p
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,*p1,*p2;
clrscr();
printf("\n\n\t Enter The Values Of A and B:");
scanf("%d %d",&a,&b);
*p1=a;
*p2=b;
b=*p1;
a=*p2;
printf("\n\n\t The Values Of Elements After Swapping Is:%d %d",a,b);
getch();
}
| Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What does c mean before a date?
How can you tell whether two strings are the same?
What is printf () in c?
Explain the bubble sort algorithm.
Can you please explain the difference between malloc() and calloc() function?
formula to convert 2500mmh2o into m3/hr
How can I call a function with an argument list built up at run time?
What is clrscr in c?
How are Structure passing and returning implemented by the complier?
is it possible to create your own header files?
Does c have enums?
What are operators in c?
Explain what are compound statements?
How can I recover the file name given an open stream?
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none