Department of Computer Science and Engineering
NITK, Surathkal
Tutorial and Laboratory Questions
(B. Tech 2nd Semester, 2018-19)
Subject: Computer Programming (Theory & Lab)
(NG#@! This is to record the questions used for tutorial and Lab. It is requested to the
respective course instructors to write your section no. in the 3rd and 4th column of the
respective question, which is discussed the class (tutorial) and asked for execution in regular
lab. Q1, Q2, and so on is the list of questions available in the pool (click here),
Question Section Section-Batch
Brief Description
Code (Theory) (Lab)
Common prime factors of given two
a $1 (03.01.19)
numbers
No. of classes to be attended to get
a2 $1 (03.01.19)
75% attendance
Finding pair of integers (x, y) such
3
that (x + y) mod A/B = 0
os Finding units place digit of the first N
natural numbers factorials
5 Input/Output Programs
‘What happens if the short, int, long int
variables data is exceeding their
range of values respectively. For
6 $2 (10.01.19)
instance, what happens if a short
variable is holding the value of
12312317
Understand the concept of implicit
a7 $2 (10.01.19)
type conversion.
Draw algorithm and flowchart to
8 | accept the number of days $6(09.01.19)
the member is late to retum the bookand display the fine or
the appropriate message.(problem
statement given separately)
ag
write a algorithm and flowchart to
calculate sum of digits of the 5-digit
number
$6(09.01.19)
ato
Write a C Program to input two
angles from user and find third angle
of the triangle,
$6(14,01.19)
an
Program to format printf() on integer
and float data type.
$6(14.01.19)
a1
program to express a length X given
in millimetres in meters, centimeters
and millimeters.
$6(18.01.19)
a3,
use of scanf() and print() function
perform input and output on primitive
types in C programming
$6(18,01.19)
ara
program to swap two number without
using temporary variable,
$3(14 Jan 19)
ais
program to read two integers a & b.
Calculate value of (a+b)?
a) with using pow() function
b) without using pow() function
$3(14 Jan 19)
ate
Write a C program to convert feet to
inches.
$4(14 Jan 19)
a7
Write ¢ program to print the variables
using format specifiers in print).
$4(14 Jan 19)
ars
Problem: Write an appropriate
definition for each of the following
symbolic constants, as it would
appear within a C program. Program
output should print a statement as:
Pen Drive Cost is:
$4(15 Jan 19)20.25
ara
Program to format printf() and scanf()
on integer and float data type.
$3(18 Jan 19)
Q20
C program to leam about escape
sequences.
$3(18 Jan 19)
21
In a town, the percentage of men is
52. The percentage of total literacy is
48. If total percentage of literate men
is 35 of the total population, write a
program to find the total number of
illiterate men and women if the
population of the town is 80,000.
'$4(11 Jan 19)
a22
The distance between two cities (in
km.) is input through the keyboard.
Write a program to convert and print
this distance in meters, feet, inches
and centimeters.
'$4(11 Jan 19)
Q23
024
25