Skip to content

Instantly share code, notes, and snippets.

@ddio
Last active August 29, 2015 14:06
Show Gist options
  • Save ddio/d9f07c3ef44141930579 to your computer and use it in GitHub Desktop.
Save ddio/d9f07c3ef44141930579 to your computer and use it in GitHub Desktop.
private void DoSomething(int number)
{
for(int i=0; i<=number; i++)
{
if(i%15 == 0)
{
Console.WriteLine("InterFace");
}
else if (i%3 == 0)
{
Console.WriteLine("Inter");
}
else if (i%5 == 0)
{
Console.WriteLine("Face");
}
else
{
Console.WriteLine(i.toString());
}
}
}
function dosth( a ) {
for( i = 0; i <= a; i++ ) {
if( i % 15 == 0 ) {
console.log( 'InterFace' );
} else if( i % 3 == 0 ) {
console.log( 'Inter' );
} else if( i % 5 == 0 ) {
console.log( 'Face' );
} else {
console.log( i );
}
}
}
@ddio
Copy link
Author

ddio commented Sep 12, 2014

DoSomething(5)

InterFace
1
2
Inter
4
Face 

@ddio
Copy link
Author

ddio commented Sep 12, 2014

DoSomething(10)

InterFace
1
2
Inter
4
Face
Inter
7
8
Inter
Face

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment