forked from tarunsinghofficial/HacktoberFest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request tarunsinghofficial#685 from adityag200/main
Create aditya.md
- Loading branch information
Showing
2 changed files
with
21 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
num1 = input('Enter First Number: ') | ||
num2 = input('Enter Second Number: ') | ||
num1 = int(input('Enter First Number: ')) | ||
num2 = int(input('Enter Second Number: ')) | ||
|
||
print("Value of num1 before swapping: ", num1) | ||
print("Value of num2 before swapping: ", num2) | ||
|
||
# swapping two numbers using temporary variable | ||
temp = num1 | ||
num1 = num2 | ||
num2 = temp | ||
print("for swapping with using a temp variable enter number greater than 1 otherwise swapped without third variable") | ||
choice = int(input("enter the choice: ")) | ||
if choice > 1: | ||
#swapping two numbers using temporary variable | ||
temp = num1 | ||
num1 = num2 | ||
num2 = temp | ||
print("Value of num1 after swapping using the third variable: ", num1) | ||
print("Value of num2 after swapping using the third variable: ", num2) | ||
|
||
print("Value of num1 after swapping: ", num1) | ||
print("Value of num2 after swapping: ", num2) | ||
else: | ||
# swapping two number not using the third variable | ||
num1,num2 = num2,num1 | ||
print("Value of num1 after swapping not using the third variable: ", num1) | ||
print("Value of num2 after swapping not using the third variable: ", num2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Aditya Gaur | ||
|
||
Photo: https://images.unsplash.com/photo-1563170261-90260910461d?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&w=1000&q=80 | ||
Location: India | ||
Github: https://github.com/adityag200 |