Swapping(Interchanging) two numbers in c is basic program to try. To swap two numbers you can use a third number. First of all store 1st number in 3rd, then 2nd in 1st, now 3rd in 2nd and you will get swapped numbers in the 1st and 2nd variable.Follow these instructions
- 1st of all use #include<stdio.h> header file so that you can use instructions like printf, scanf, etc..
- printf(“…..”) instructions is used to print text at output window
- scanf(“……”) instruction is used to get data from user
You can easily download c file from here. so take care and enjoy…….
Incoming search terms:
- swap two number in c (1)