Takes an integer input from the user. Checks whether the number is even or odd using an if-else statement. Displays the result accordingly. Task 2: Sum of Integers from 1 to 50 Using a Loop Uses a for ...
Once again, run a for loop with a range. Inside the loop, use the power of 2. Then add that power to a sum variable. That’s it. This one is super easy. You declared a variable sum with an initial ...