Ron_Kadouri

שיעור 1 תרגיל 1

Sep 15th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. using System;
  2. namespace Sum_Of_Two_Numbers
  3. {
  4. class Program
  5. {
  6. static void Main(string[] args)
  7. {
  8. Console.WriteLine(" Hello World!");
  9. int num1;
  10. int num2;
  11. int sum;
  12. // Write a message to the screen to enter the first number
  13. // כתוב הודעה למסך להקליד את המספר הראשון
  14. Console.WriteLine(" Insert the first number: ");
  15. // Read the first number
  16. // קרא את המספר הראשון
  17. num1 = int.Parse(Console.ReadLine());
  18. // Write a message to the screen to enter the first number
  19. // כתוב הודעה למסך להקליד את המספר הראשון
  20. Console.WriteLine(" Insert the first number: ");
  21. // Read the first number
  22. // קרא את המספר הראשון
  23. num2 = int.Parse(Console.ReadLine());
  24. // Add the two numbers
  25. // חסר את שני המספרים
  26. sum = num1 - num2;
  27. // Print a message with the result to the screen
  28. // הדפס את התוצאה למסך
  29. Console.WriteLine(" The sum of the two numbers you entere is: " +sum);
  30. Console.ReadLine();
  31. }
  32. }
  33. }
Add Comment
Please, Sign In to add comment