Total numbers of even numbers between 1-100

In this program, we will count total numbers of even numbers between 1-100.

Steps to solve the program
  1. Create a count variable and assign its value equal to 0.
  2. Use for loop with the range function to iterate over values between 1-100.
  3. If a number is an even number then add 1 to the count variable.
  4. Print the output.
				
					count = 0

for i in range(1,101):
    if i%2 == 0:
        count += 1
        
print("Total numbers of even number: ",count)
				
			

Output :

				
					Total numbers of even number:  50
				
			

print the pyramid structure

count the total numbers of odd numbers between 1-100

Leave a Comment