Format Assignment
Format Assignment
Submitted by Submitted To
Name: Tahsin Tarif Mahit Kumar Paul
Roll: 2201011 Assistant Professor
Department of EEE Department of CSE
RUET, Kazla, Rajshahi-6204 RUET, Kazla, Rajshahi-6204
Table of Contents
SI# Problem Statements Page#
01. Write down a program that can take two numbers (a,b) as input and find 5
out the addition (a+b), subtraction(a-b), multiplication(a*b) and
division(a/b) of two numbers.
02 Write down a program that can take the radius of a circle and find out its 6
Area.
03 Write down a program that can take the base and height of a triangle and 7
then find out its Area.
04 Write down a program that can take two numbers as input and then find 8
out which number is bigger.
05 Write down a program that can take three numbers as input and find out 9-10
which number is bigger.
06 Write down a program that can take two numbers as input and then find 10-11
out which number is bigger (without using if-else statement)
07 Write down a program that can take three numbers as input and then find 11-12
out which number is bigger (without using if-else statement).
08 Write down a program that can take a number as input and find out it is 12-13
odd or even.
09 Write down a program that can take a year as input and find out it is leap 14-15
year or not. (Study about the leap year first).
10 Write down a program that can take the values of a, b and c then find out 15-16
the value of x when ax2+bx+c=0
11 Write down a program that can take two numbers and find out their 16-17
difference. The result shows the difference in a positive number.
12 Write down a program that can take a letter as input and then convert it to 18-19
uppercase if it is lowercase and vice versa
13 Write down a program that can take a character as input and then convert 19-20
it to its ASCII equivalent.
14 Write down a program that can take marks (out of 100) as input and then 20-22
show the grade as output. (Study about RUET grading system first, from
your syllabus)
15 Find out the summation of following series (take n as a input): 22-23
1+2+3+…………………………………+n
16 Write down a program that can take a lower bound L and an upper bound 23-24
U and then find out the summation of all odd numbers from L to U
17 Write down a program that can take a lower bound L and an upper bound 24-25
U and then find out the summation of all even numbers from L to U
18 Write down a program that can take a lower bound L and an upper bound 25-26
U and then find out the summation of all numbers which are divisible by
3 from L to U.
19 Write down a program that can take n numbers as input and then find out 26-27
their average.
20 Write down a program that can take n numbers as input and then find out 27-28
the average of those numbers which is greater than 10
Page 2 of 4
21 Write down a program that can take n as input then generate the square of 28-29
numbers. Sample Input: 3 Sample Output:
123
456
789
22 Generate the following triangle. Sample Input: 5 Sample Output: 29-31
*
***
*****
*******
*********
23 Generate the following triangle. Sample Input: 5 Sample Output: 31-32
1
121
12321
1234321
123454321
24 Generate the following triangle. Sample Input : 5 Sample Output: 32-34
1
131
13531
1357531
135797531
25 Write down a program that can take a number as input and then reverse 34
that number ( do not use strrev() function). Sample Input: 12345 Sample
Output: 54321
26 Write down a program that can take a number as input and then find out it 35-36
is prime or not
27 Write down a program that can take a lower bound L and an upper bound 36-38
U and then print the prime numbers from L to U
28 Write down a program that can take n numbers as input and then find out 38-39
the GCD of n numbers.
29 Write down a program that can take n numbers as input and then find out 39-41
the LCM of n numbers.
30 Write down a program that can take a lower bound L and an upper bound 41-42
U and find out the summation of all odd numbers using a function named
sum, from L to U
31 Write down a program that can take a lower bound L and an upper bound 42-43
U and find out the average of all even numbers using a function named
average, from L to U
Page 3 of 4
Page 4 of 4