You are on page 1of 1

2nd Assignment of Introduction to Programming I

Due Date: Saturday, 1399/11/11, Time: 5:00 PM


You should write the assignment on paper and then make a pdf file and named
assignment02-ID.
1. Accept two integers x and y and calculate the sum of all integers between x
and y (both inclusive)
2. Write a program to accept two integers x and n and compute xn
3. Write a program to accept an integer and check if it is prime or not.
4. Write a program to display the given pattern. (here n=4).
1
22
333
4444
5. Write a program to display the given pattern. (here n=4).
1
23
456
7 8 9 10
6. Write a program to display the given pattern. (here n=4).
ABCD
EFG
HI
J
7. Write a program to accept an integer, count number of digits and calculate
sum of digits in the number. Example: Number = 1234 Output: Digits = 4,
Sum = 10.

You might also like