Anis Ahmed
Anis Ahmed
Submitted By
Ans. INPUT:
OUTPUT 1:
OUTPUT 2:
OUTPUT 3:
Q,no2:(a) Write a Python program that prints the first 10 natural numbers using a for loop.
INPUT:
OUTPUT:
Q.no2: (b) Write a Python program that prints the first 10 natural numbers using a while
loop.
INPUT:
OUTPUT:
Q.no2: (c) Write a Python program that calculates the sum of all even numbers from 1 to
50 (inclusive) using a for loop and prints the result.
INPUT:
OUTPUT :
Q.no2: (d) Write a Python program that calculates the product of all odd numbers from 1 to
15 (inclusive) using a while loop and prints the result.
INPUT:
OUTPUT :