0% found this document useful (0 votes)
2 views1 page

PP Loop

The document outlines a series of practice programming problems for CSE 110 Computer Programming Sessional. It includes tasks such as computing powers, checking for prime numbers, finding divisors, calculating factorials, and summing various series. Additionally, it emphasizes the use of different types of loops to solve each problem.

Uploaded by

Hunter008
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

PP Loop

The document outlines a series of practice programming problems for CSE 110 Computer Programming Sessional. It includes tasks such as computing powers, checking for prime numbers, finding divisors, calculating factorials, and summing various series. Additionally, it emphasizes the use of different types of loops to solve each problem.

Uploaded by

Hunter008
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

CSE 110 Computer Programming Sessional

Practice Problem on Loop

1. Write a program that takes two integer x and n and computes x^n.
2. Write a program that takes an integers and determines if it is prime or not.
3. Write a program that finds out all the divisors of a number.
4. Write a program that takes an integer n and computes factorial of n. (n!)
5. Write a program that takes takes n integers and finds out the maximum/minimum.
6. Write a program that takes as input an integer and computes the sum of the following
series upto nth term.
a. 1 + 2 + 3 + ... ... + n
b. 12 + 22 + 32 + ... ... + n2
c. 11 + 12 + 13 + ... ... + 1n
1 1 1 1
d. 1 + 2 + 3 + ... ... + n
e. 2 + 4 + 6 + ... ... upto nth term
f. 2 + 4 + 8 + 16 + ... ... upto nth term
g. 1 − 2 + 3 − 4 ... ... upto nth term
7. Write a program that reverses the digits of an integer n. (For example, if the given
integer is 1234 you program should output 4321)
8. Write a program that determines whether n is a perfect number. A perfect number is a
number such that the sum of its divisors is equal to the number. Example of a few
perfect numbers are 6, 28, 496, 8128.
9. Write a program that prints all the prime numbers that is less than a given integer n.
10. Practice each of the above problems with different types of loops i.e. for loop, while loop,
do-while loop.

You might also like