Q1.
num=int(input("num: "))
sum=0
while num>0:
if num%2==0:
sum+=num
num-=1
print("sum:",sum)
Q2.
# Python program to find the sum of integers between 0 and n where n is provided by user
num=int(input("num: "))
sum=0
if (num>0):
while(num>=0):
sum=sum+num
num-=1
else:
while num<0:
sum=sum+num
num+=1
print("sum:",sum)
Q3.
x=int(input("x: "))
y=int(input("y: "))
i=1
if x!=0 and y!=0:
while(y>0):
rem=y%x
x=y
y=rem
print("gcd:",x)
else:
print("value must be non zero")
Q4.
# Write your code here
x=int(input("k: "))
a=0
b=1
i=0
sum1=0
while(a<x):
print(a)
if i%2==0:
sum1=sum1+a
next_term=a+b
a=b
b=next_term
i+=1
print("sum:",sum1)
Q5.
x=int(input("k: "))
y=0
while y<x:
if y%2==0:
print(y,"even number")
else:
print(y,"odd number")
y+=1
Q6. Need Solution