fork download
  1. using System;
  2.  
  3. public class Test
  4. {
  5. Console.WriteLine ("Enter a number");
  6. string inputNumber = Console.ReadLine();
  7. int inputNumberParsed = int.Parse(inputNumber);
  8.  
  9. if (inputNumberParsed % 1 = 0)
  10. {
  11. Console.WriteLine ("1");
  12. }
  13. if (inputNumberParsed % 2 = 0)
  14. {
  15. Console.WriteLine ("2");
  16. }
  17. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
4
compilation info
prog.cs(5,21): error CS1519: Unexpected symbol `(' in class, struct, or interface member declaration
prog.cs(9,4): error CS1519: Unexpected symbol `if' in class, struct, or interface member declaration
prog.cs(9,25): error CS1519: Unexpected symbol `%' in class, struct, or interface member declaration
prog.cs(10,3): error CS9010: Primary constructor body is not allowed
prog.cs(13,4): error CS1519: Unexpected symbol `if' in class, struct, or interface member declaration
prog.cs(13,25): error CS1519: Unexpected symbol `%' in class, struct, or interface member declaration
prog.cs(14,3): error CS9010: Primary constructor body is not allowed
prog.cs(14,3): error CS8041: Primary constructor already has a body
Compilation failed: 8 error(s), 0 warnings
stdout
Standard output is empty