SRMINSTITUTE OF SCIENCE AND TECHNOLOGY
Ramapuram Campus, Bharathi Salai, Ramapuram, Chennai - 600089
FACULTY OF ENGINEERING AND TECHNOLOGY
DEPARTMENT
OFCOMPUTERSCIENCEANDENGINEERIN
G
QUESTIONBANK
DEGREE / BRANCH: __B.Tech/CSE with Specializations AIML, BDA,CS and
IOT
___SEMESTER
SUB CODE:18CSC206J SUBJECT NAME:PROGRAMMING FOR PROBLEM
SOLVING
Regulation–2018
AcademicYear2021-2022
SRMINSTITUTE OF SCIENCE AND TECHNOLOGY
Ramapuram Campus, Bharathi Salai, Ramapuram, Chennai-600089
DEPARTMENTOFCOMPUTERSCIENCEANDENGINEERING
QUESTIONBANK
SUBJECT : Subject Code - Subject Name
SEM/YEAR:IV/II
Course Outcomes
CO1:Identify methods to solve a problem through computer programming. List the basic data
types and variables in C
CO2:Apply the logic operators and expressions. Use loop constructs and recursion. Use array
to store and retrieve data
CO3:Analyze programs that need storage and form single and multi-dimensional arrays. Use
preprocessor constructs in C
CO4:Create user defined functions for mathematical and other logical operations. Use pointer
to address memory and data
CO5:Create structures and unions to represent data constructs. Use files to store and retrieve data
CO6:Apply programming concepts to solve problems. Learn about how C programming can be
effectively used for solutions
UNITI
Evolution of Programming & Languages, Problem solving through programming, Creating algorithms,
Drawing flowcharts, Writing pseudocode, Evolution of C language, its usage history, Input and output
functions: Printf and scanf, Variables and identifiers, Expressions, Single line and multiline comments,
Single line and multiline comments, Values, Names, Scope, Binding, Storage Classes, Numeric Data types:
integer, Numeric Data types: floating point, Non-Numeric Data types: char and string, Increment and
decrement operator, Comma, Arrow and Assignment operator, Bitwise and Sizeof operator
PART-A (Multiple Choice Questions)
Q. Questions Course Competence
Outcome BT Level
No
1 Data types are differed on the basis of CO1 L2
a. the way of storage
b.the type of operations
c. the type of operators used
d.both a and b
2 What is the difference between a flowchart and pseudocode? CO1 L1
a.A flowchart is diagrammatic whilst pseudocode is written in a
programming language (eg. Pascal or Java)
b.A flowchart is textual but pseudocode is diagrammatic
c.A flowchart is a diagrammatic description of an algorithm whilst
pseudocode is a textual description of an algorithm
d.A flwochart and pseudocode are the same thing
3 which symbol is been used for processing in flowchart? Ans: a CO1 L2
a.
4 What is the value of x in this C code? [PLO 2] [CLO 1] CO1 L3
#include <stdio.h>
void main()
{
int x = 5 * 9 / 3 + 9;
}
a. 3.75
b. Depends on compiler
c. 24
d. 3
5 Every statement in C program is to be terminated by a__________ CO1 L1
a. dot(.)
b. semi-colon(;)
c. colon(:)
d. Question mark(?)
6 C programming language is
a. object oriented programming language
b. Procedure oriented programming language CO1 L1
c. function oriented programming language
d. None of the above
7 Which of the following is the correct way of writing comments?
a.*/comments/*
b./*comment*/ CO1 L2
c.**comment**
d.{comment}
8 The format identifier ‘%i’ is also used for _____ data type.
a. char
b. int CO1 L2
c. float
d. double
9 Which of the following is true for variable names in C?
a. They can contain alphanumeric characters as well as special characters
b. It is not an error to declare a variable to be one of the keywords(like
CO1 L2
goto, static)
c. Variable names cannot start with a digit
d. Variable can be of any length
10 Which of the following is not a valid variable name declaration?
a. int _a3;
b. int a_3; CO1 L2
c. int 3_a;
d. int _3a
11 ----------------- means the set of instructions that make up the solution after
they have been coded into a programming language.
a. solution L1
CO1
b. result
c. program
d. error
12 What is the only function all programs must contain ?
CO1 L1
a.start()
b. system()
c. main()
d. program
13 Choose a right statement.
float var =3.5 + 4.5;
a.var = 8.0 CO1 L2
b. var = 8
c. var = 7
d. var = 0.0
14 What is the size of an int data type?
a. 4 Bytes
b. 8 Bytes CO1 L1
c. Depends on the system/compiler
d. Cannot be determined.
15 Which of the following shows the correct hierarchy of arithmetic
operations in C
a. / + * -
CO1 L1
b. * -/ +
c. + - / *
d. * / +
16 In an expression involving || operator evaluation
I. will be stopped if one of its components evaluates to false
II. will be stopped if one of its components evaluates to true
III. takes place from right to left
IV. takes place from left to right CO1 L2
a. I and II
b. I and III
c. II and III
d. II and IV
17 If both numerator and denominator of a division operation in C language
are integers, then we get.?
a. Expected algebraic real value CO1 L2
b.unexpected integer value
c. Compiler error.
d.Syntax error
18 Which of the following is the correct way of writing comments?
a.*/comments/*
b./*comment*/ CO1 L1
c.**comment**
d.{comment}
19 which of the following will not valid expressions in C?
a. a=2+(b=5);
b. a=11%3 CO1 L1
c. a=b=c=5
d.b+5=2
20 What is the output of this C code?
#include
int main()
{ CO1 L3
signed char chr;
chr = 128;
printf("%d\n", chr);
return 0;
}
a) 128
b) -128
c) Depends on the compiler
d) None of the mentioned
21 For 16-bit compiler allowable range for integer constants is ________?
a. -3.4e38 to 3.4e38
b. -32767 to 32768 CO1 L1
c.-32668 to 32667
d. -32768 to 32767
22 What is the value of x in this C code?
#include <stdio.h>
void main()
{
int x = 5 * 9 / 3 + 9;
CO1 L3
}
a. 3.75
b. Depends on compiler
c.24
d. 3
23 Which of the following data type will throw an error on modulus
operation(%)?
a. char
b. short CO1 L3
c. float
d. int
24 What is the output of this program?
void main()
{
int a, b = 5, c;
a = 5 * (b++);
c = 5 * (++b);
CO1 L3
printf("%d %d",a,c);
}
a. 30 35
b. 30 30
c. 25 30
d. 25 35
25 Which bitwise operator is suitable for checking whether a particular bit is
on or off?
a. && operator
CO1 L1
b. &operator
c. || operator
d. ! operator
PART B (4 Marks)
1 What is an algorithm? Give the characteristics of the algorithm. CO1 L1
2 What is a flowchart? Give the symbols/shapes used in the flowchart. CO1 L2
3 Define pseudocode and give its importance with an example. CO1 L1
4 What is main difference between variable and constant? CO1 L1
State the use of %d and %f .Write a printf statement in C using the above
5 CO1 L2
mentioned symbols?
What is an assignment statement? Give the general form of an assignment
6 CO1 L2
statement
7 Write a C program in C to find the area and perimeter of a circle CO1 L3
What is an expression? Evaluate the following expressions
8 CO1 L2
a + = b * = C - = 5 where a=3 b=5 and c=8
PART C (12 Marks)
Explain in detail about the various steps involved in problem solving with
1 CO1 L1
diagram.
2 Write in detail about the scope and lifetime of variable in C with example. CO1 L1
Write an algorithm ,flowchartand c program to find sum and average of
3 CO1 L3
three numbers.
4 Write detailed notes on C data types with example. CO1 L2
Discuss about the following operators in C language with example
a. Bitwise operators
5 CO1 L3
b. Assignment operators
c. Increment and decrement operators
Note:
1. BT Level – Blooms Taxonomy Level
2. CO – Course Outcomes
BT1 –RememberBT2 – Understand BT3 – Apply BT4 – Analyze BT5 – Evaluate BT6 – Create