Advertisement
KodingKid

C# enum fractions

Apr 10th, 2021
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.48 KB | None | 0 0
  1. enum Fractions
  2. {
  3. 1/1000 = 0.001 //0
  4. 1/500 = 0.02 //1
  5. 1/300 = 0.0333 //2
  6. 1/200 = 0.05 //3
  7. 1/100 = 0.01 //4
  8. 1/10 = 0.1 //5
  9. 1/2 = 0.5 //6
  10. }
  11. Console.WriteLine(Fractions.1/1000) //prints 0.001
  12. Console.WriteLine(Fractions.1/500) //prints 0.02
  13. Console.WriteLine(Fractions.1/300) //prints 0.333
  14. Console.WriteLine(Fractions.1/200) //prints 0.05
  15. Console.WriteLine(Fractions.1/100) //prints 0.01
  16. Console.WriteLine(Fractions.1/10) //prints 0.1
  17. Console.WriteLine(Fractions.1/2) //prints 0.5
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement