Presiding Officer Training module 2024 lok sabha elections
Exp 1
1. CSE 1111
Fundamentals of Computer and
Computing Lab
Exp 1 – scanf, printf and variables
Department of Computer Science
and Engineering
University of Dhaka
2. Instructions
• Solve all the problems using only scanf, printf
and simple arithmetic operations.
• You are not allowed to use any if else, loop or
any other advanced constructs.
• You are not allowed to discuss to each other.
Please ask your teacher about any concerns.
09-May-16 2
3. Today’s experiments - 1
• s = ut + (at2)/2. Take as input u, a and t.
Calculate s using the formula. Print the value
of s.
09-May-16 3
4. Today’s experiments - 2
Given an angle (in degree), convert that to radian
and show sin and cos of that angle (up to three
decimal places). (use functions from math.h
header file)
Example:
Enter angle: 60
Radian: 1.04
sin(60) = 0.866
cos(60) = 0.500
09-May-16 4
5. Today’s experiments - 3
Take a number n as input and show the multiplication table for n.
Example:
Enter n: 7
Multiplication table for 7
******************
7 X 1 = 7
7 X 2 = 14
7 X 3 = 21
7 X 4 = 28
7 X 5 = 35
7 X 6 = 42
7 X 7 = 49
7 X 8 = 56
7 X 9 = 63
7 X 10 = 70
*******************
09-May-16 5
6. Today’s experiments - 4
Given two time find the absolute difference between them in minutes.
You may assume that times are given in 24 hour format and the first
time is always smaller than the second. That means if the second
time looks smaller, its from the next day (example 2). You cannot
use any if else to solve the problem.
Example 1:
Enter first time: 11 20
Enter second time: 12 40
Difference: 80 minutes
Example 2:
Enter first time: 13 20
Enter second time: 12 40
Difference: 1400 minutes
09-May-16 6
7. Today’s experiments - 5
Write a program that will take a 6 digit integer number as input and show
each digit of the number in a separate line. Also, print the sum of digits.
Example:
Please enter a 6 digit number:
349701
Digits are:
3
4
9
7
0
1
Sum of digits = 24
09-May-16 7