Created
July 30, 2017 17:18
Star
You must be signed in to star a gist
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
namespace YouNameThisNamespace | |
{ | |
public class ExampleClass | |
{ | |
public static int GetGCF(int num1, int num2) | |
{ | |
// Declare variables | |
int a = num1; | |
int b = num2; | |
int r = 0; | |
// Action 1 | |
while (a > 0 && b > 0) | |
{ | |
r = a % b; | |
a = b; | |
b = r; | |
} | |
// Action 2 | |
return a > 0 ? a : b; | |
} | |
} | |
} |
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
This is how most developers usually do it. | |
Notice there is only one extra spacing between different clusters. | |
Declarations, space, action, space, action, and so on. | |
There aren't any extra spacings before or after curly braces either, except where | |
it ends the action, declaration, or whatever cluster. | |
Hope this makes sense :) | |
-Sometowngeek |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment