Advertisement
Guest User

Untitled

a guest
Feb 18th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp7
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int firstNum = int.Parse(Console.ReadLine());
  14. int secNum = int.Parse(Console.ReadLine());
  15. int thirdNum = int.Parse(Console.ReadLine());
  16.  
  17. Console.WriteLine(SmallestNumber(firstNum, secNum, thirdNum));
  18.  
  19.  
  20. }
  21. static int SmallestNumber(int firstNum, int secNum, int thirdNum)
  22. {
  23. if (firstNum < secNum && firstNum < thirdNum)
  24. {
  25. return firstNum;
  26. }
  27. else if (secNum < firstNum && secNum < thirdNum)
  28. {
  29. return secNum;
  30. }
  31. else
  32. {
  33. return thirdNum;
  34. }
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement