Shtiler

Average of 4 numbers

Sep 18th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 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 homework_2
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int num1;
  14. int num2;
  15. int num3;
  16. int num4;
  17. int sum;
  18. double avg;
  19. Console.WriteLine("Insert The First Number: ");
  20. num1 = int.Parse(Console.ReadLine());
  21. Console.WriteLine("Insert The Second Number:");
  22. num2 = int.Parse(Console.ReadLine());
  23. Console.WriteLine("Insert The Third Number: ");
  24. num3 = int.Parse(Console.ReadLine());
  25. Console.WriteLine("Insert The Fourth Number");
  26. num4 = int.Parse(Console.ReadLine());
  27. sum = num1 + num2 + num3 + num4;
  28. avg = sum / 4;
  29. Console.WriteLine("The Average Of The Four Numbers You Entered is :"+avg);
  30. Console.ReadLine();
  31.  
  32. }
  33. }
  34. }
Add Comment
Please, Sign In to add comment