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 is void pointers in c?
What is the significance of an algorithm to C programming?
Are the expressions * ptr ++ and ++ * ptr same?
How to set file pointer to beginning c?
What is #include conio h?
What is a program flowchart?
How does normalization of huge pointer works?
Find duplicates in a file containing 6 digit number (like uid) in O (n) time.
we need to calculating INCOME TAX for the person. The INCOME TAX is as follows:- First $10000/- of income : 4% tax Next $10000/- of income : 8% tax Next $10000/- of income : 11.5% tax above $10, 00,00/- : 15% tax What is the Solution of this Question ?
What are the usage of pointer in c?
In which header file is the null macro defined?
Explain what is the difference between the expression '++a' and 'a++'?
Why we use void main in c?
How can I handle floating-point exceptions gracefully?
What does %p mean?