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 nested structure in c?
What are linked lists in c?
Who developed c language and when?
Describe newline escape sequence with a sample program?
What is difference between static and global variable in c?
Explain what’s a signal? Explain what do I use signals for?
Why is c so important?
How can I make sure that my program is the only one accessing a file?
Why is c called a mid-level programming language?
What are pointers? What are different types of pointers?
how could explain about job profile
Is fortran still used today?
What is the difference between declaring a variable and defining a variable?
Which is better malloc or calloc?
Write a program in c to replace any vowel in a string with z?