Practice Problems on Iterations

1. Print the terms of these series up to n term, calculate the sum of these series up to n term, n will be taken as input:

  • 1+2+3+4+...
  • 1+3+5+7+...
  • 2+4+6+8+...
  • 1+2+4+8+...
  • 1+4+9+16+...

2. Calculate the approximate value of these functions using Taylor series up to n term, n will be taken as input: 

  • e
  • e^x, x will be taken as input
  • sin x, x in degree will be taken as input
  • cos x, x in degree will be taken as input
  • log (1+x)
  • log (1-x)

3. Take a non negative integer, n as input and print all the integers, a such that n is divisible by a. 

4. Take a non negative integer as input and check whether it's a prime number.

5. Take a non negative integer, n as input and print all the prime numbers up to n.

6. Print all the non negative integers below 200 that are multiples of 3 and 5. [Original Source: here]

7. Find the greatest common  divisor for two numbers, n and m, taken from input.


DiscussionStarted byRepliesLast post
Discussion Picture of Tanvir Ahmed Khan Tanvir Ahmed Khan 0 Tanvir Ahmed Khan
Wed, 10 Sep 2014, 3:03 AM