Created
December 26, 2010 12:30
-
-
Save samnang/755398 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
//Swap value between two variables | |
int a = 5, b = 10; | |
int temp = a; | |
a = b; | |
b = temp; | |
//Output message 3 times | |
for(int i = 0; i <= 3; i++) | |
Console.WriteLine("Hello"); | |
//Output message if condition is true string | |
str = string.Empty; | |
if(str == string.Empty) | |
Console.WriteLine("str is empty"); |
This file contains hidden or 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
#Swap value between two variables | |
a, b = 5, 10 | |
a, b = b, a | |
#Output message 3 times | |
3.times { puts "Hello" } | |
#Output message if condition is true | |
str = '' | |
puts "str is empty" if str.empty? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment