GeekInterview
|
Geeks Forum
|
Online Quiz
|
Learning Center
|
Privacy
|
Terms and Conditions
|
Contact
Home
>
Code Samples
>
C/C++
> C++ Swap Numbers
C++ Swap Numbers
Description:
Swap Two No.s Without Using Third No.
Date added:
15 November, 2007
Submitted By:
bipin_vaylu
Rating:
0
Download:
N/A
Instructions:
Copy This Code Into Notepad and save with extesion .c then run in c editor
Source Code:
/* Swap Two No.s */ #include
#include
void main() { int no1,no2; clrscr(); printf("Enter First No::"); scanf("%d",&no1); printf("Enter Second No::"); scanf("%d",&no2); printf("Before Swapping \n First No=%d\tSecond No=%d",no1,no2); no1=no1+no2; no2=no1-no2; no1=no1-no2; printf("After Swapping \n First No=%d\tSecond No=%d",no1,no2); getch(); return 0; }
WidgetBucks - Trend Watch - WidgetBucks.com
Comments
[
Leave Comment
]
Your name:
E-mail (optional):
Text:
Please enter code
shown on image:
No comments posted yet. Be the first one to comment.
Tips
[
Leave Tip
]
Your name:
E-mail (optional):
Text:
Please enter code
shown on image:
No tips added yet. Be the first one to share tip.
Reviews
[
Leave Review
]
Your name:
E-mail (optional):
Rate:
1
2
3
4
5
6
7
8
9
10
Text:
Please enter code
shown on image:
No reviews added yet. Be the first one to review.
Tags
Source Code
Related Items
XML CODE
Customer List With Edit and Delete Options
Split Name to First and last Name
Function pointers and Function returning pointers
Random Password Generation function
Related Categories
Code Samples » C/C++
Oracle » Database » C/C++
DB2 » Database » C/C++
MYSQL » Database » C/C++
SQL Server » Database » C/C++
Copyright @
GeekInterview.com