answersLogoWhite

0

Write a program to swap any number?

Updated: 8/10/2023
User Avatar

Wiki User

12y ago

Best Answer

Do write, but before you start, please explain what does swapping a number mean.

User Avatar

Wiki User

12y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

for example a =5 and b=10

then answer is

a = a+b; //a = 5+10 = 15

b=a-b; // b= 15-10= 5

a= a-b; // a= 15-5 = 10

This answer is:
User Avatar

User Avatar

Wiki User

14y ago

x = a
a = b
b = x

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write a program to swap any number?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Write a program which takes any number of days from the user the program should display the number of years number of months formed by these days as well as the remaining days?

Write a program which takes any number of days from the user. the program should display the number of years, number of months formed by these days as well as the remaining days.


Write a program using 8086 instructions to double a number?

There isn't a reason to write a complete program to do this; in any assembly language just shift the value 1 bit to the left to double it.


Write a program which will rise any number X to a positive power nobtain values of X and n from user?

user-generated content: disclaimer report abuse = Write a program which will rise any number X to a positive power nobtain values of X and n from user? =


Write a programme for substraction of two numbers in c language?

substracion of any two number program in c


How do you write half a number plus seven?

if you want to add just a half it it 0.5 + 7 = 7.5 but if it is any more you would just swap the 0 for whatever number you wanted e.g. 5.5+7=12.5


It 4-1 solved question papers November -2008?

Write a program to count the number of IS in any number in register B and put the count in R5.


What kind of software program can one write?

Any kind that you can figure out how to write.


Write the program in Linux to find the reverse of any string?

i am sam


Write a program for sorting for numbers without repited values?

Any number variable is extends the Number in java and it already implemented Comparable interface. So when you have a list of numbers, just use Arrays.sort().


How do you write a rational number?

Not too tough . . . Any number that you can completely write down on paperis a rational number.


Any integer is input through the keyboard write a c program to find out whether it is an odd number or even number?

printf(\n "ENTER THE NUMBER\t"); scanf{"%d",&a); while(a!=0); { r=a%2; if(r==0) printf("\n\n THE NUMBER IS EVEN \t"); else printf("\n\n THE NUMBER IS ODD \t"); printf ("\n ENTER THE NUMBER \t"); scanf("%d",&a); } getch(); }


How do you write the semicolon symbol in a pseudocode logic program delaing with classes?

Any of these: PRINT semicolon EMIT ; WRITE ";" etc.