(1) Write a program to calculate the sum of the series:
1/2 + 2/3 + 3/4 + 4/5 + ... + 99/100.
(2) Write a program to calculate the sum of the squares of all even numbers from 1 to 50, and print the result.
(3) Write a program that prints the odd numbers from 200 to -200 in descending order.
(4) Write a program which repeatedly reads numbers until the user enters "done". Once "done" is entered, print out the total, count, and average of the numbers. If the user enters anything other than a number, detect their mistake using try and except and print an error message and skip to the next number.
السؤال
Mohannad الجرجاوي
(1) Write a program to calculate the sum of the series:
1/2 + 2/3 + 3/4 + 4/5 + ... + 99/100.
(2) Write a program to calculate the sum of the squares of all even numbers from 1 to 50, and print the result.
(3) Write a program that prints the odd numbers from 200 to -200 in descending order.
(4) Write a program which repeatedly reads numbers until the user enters "done". Once "done" is entered, print out the total, count, and average of the numbers. If the user enters anything other than a number, detect their mistake using try and except and print an error message and skip to the next number.
2 أجوبة على هذا السؤال
Recommended Posts
انضم إلى النقاش
يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.