Programming Examples
Python program to find the sum of first n odd numbers.
WAP to find the sum of first n odd numbers.
Solution
n=int(input("Enter the Limit : "))
s=0
for i in range(1,n+1,2):
s=s+i
print("The sum is : ",s)
Output
Enter the Limit : 10
The sum is : 25