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
| public static void ft_putchar(char c) | |
| { | |
| Console.WriteLine(c); | |
| } |
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
| public static void ft_print_alphabet(){ | |
| char alph = 'a'; | |
| while(alph <= 'z') | |
| { | |
| Console.Write(alph); | |
| alph++; | |
| } |
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
| public static void ft_print_alphabet_bis(){ | |
| for(char i= 'a'; i<='z' ;i++) | |
| { | |
| Console.Write(i); | |
| } | |
| } |
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
| public static void ft_print_alphabet_bis_bis(){ | |
| string[] alph={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"}; | |
| foreach (string i in alph) | |
| { | |
| Console.Write(i); | |
| } | |
| } |
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
| public static void ft_reverse_alphabet(){ | |
| Console.Write("zyxwvutsrqponmlkjihgfedcba"); | |
| } |
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
| public static void ft_print_numbers(){ | |
| int i = 0; | |
| while(i <=9 ) | |
| { | |
| Console.Write(i); | |
| i++; | |
| } | |
| } |
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
| public static void ft_is_negative(int n) { | |
| if(n < 0) | |
| { | |
| Console.Write('N'); | |
| } | |
| else | |
| { | |
| Console.Write('P'); | |
| } |
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
| public static string ft_fizzbuzz(int number) | |
| { | |
| if (number%3 == 0 && number%5 == 0)//% modulo si == 0 divisible | |
| { | |
| Console.Write("FizzBuzz"); | |
| return "FizzBuzz"; | |
| } | |
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
| public static string ft_armstrong(int number){ | |
| int nombre = number; | |
| int total = 0; | |
| int garb = 0; | |
| while (number > 0){ | |
| garb = number % 10; | |
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
| public static string ft_bissextile(int number) | |
| { | |
| if (number%4 == 0 && number % 100 != 0 || number.ToString().Length > 3 && number % 400 == 0)// test 2004/2008 Bissextile et pas 2005 | |
| { | |
| Console.Write(number + " est Bissextile"); | |
| return "Bissextile"; | |
| } | |
| else{ Console.Write("Commune"); return "Commune";} | |
| } |
OlderNewer