Posts

coding practice-9

 write a program to print the sum of the numbers divisible by the given number T from M to N          

coding practice-9

sum of odd numbers from m to n           m=int(input())           n=int(input())           t=0           for i in range(m,n+1):               if((i%2)!=0):                   t+=i         print(t)        

coding practice-9

   write a program to print sum of even numbers from N to M natural numbers                     m=int(input())           n=int(input())           t=0           for i in range(m,n+1):               if((i%2)==0):                   t+=i           print(t)        

coding practice-9

  write a program to print sum of odd numbers from the N natural numbers           n=int(input())           s=0           for i in range(1,n+1):               if((i % 2)!=0):                   s+=i           print(s)    

coding practice-9

  write a program to print sum of even numbers from the N natural numbers           n=int(input())           s=0           for i in range(1,n+1):               if((i % 2)==0):                   s+=i           print(s)    

coding practice-9

 write a program to print sum of numbers from M to N                     m=int(input())           n=int(input())           s=0           for i in range(m,n+1):               s+=i         print(s)    

coding practice-9

 write a program to print factorial of N.                     i mport math           print(math.factorial(int(input())))