write a program to swap Two numbers without using temp variable.
Answer Posted / sams
Two numbers are input through the keyboard into two
locations C and D. Write a program to interchange the
contents of C and D.
#include<stdio.h>
#include<conio.h>
void main( )
{
int a,b,c;
clrscr( );
printf("Enter A: ");
scanf("%d",&a);
printf("Enter B: ");
scanf("%d",&b);
c=a;
a=b;
b=c;
printf("\n The New Value Of A is : %d",a);
printf("\n The New Value Of B is : %d",b);
getch();
}
| Is This Answer Correct ? | 6 Yes | 2 No |
Post New Answer View All Answers
show how link list can be used to repersent the following polynomial i) 5x+2
What is string function in c?
Tell us two differences between new () and malloc ()?
How to establish connection with oracle database software from c language?
What are nested functions in c?
What is a file descriptor in c?
what are the advantages of a macro over a function?
What are two dimensional arrays alternatively called as?
Write a program to generate random numbers in c?
Explain what is gets() function?
What is the purpose of main() function?
Do you know the use of 'auto' keyword?
Tell us something about keyword 'auto'.
What are local variables c?
Explain can the sizeof operator be used to tell the size of an array passed to a function?