Question Banks - Problem Solving Using C
Question Banks - Problem Solving Using C
Question Banks - Problem Solving Using C
C
Home Course Plan Question Banks Materials Assignments
Question Banks
Unit 1 : Introduction
Q1) Explain the basic structure of C program and explain the significance of each
section.
Q3) Describe the purpose of the qualifiers constant, identifiers, keywords and
volatile with example.
Q6) (a) How does a control string in a printf() function differ from the control
string in a scanf() function.?
https://sites.google.com/a/cmrit.ac.in/problem-solving-using-c/homework 1/12
9/11/23, 9:43 AM Question Banks - Problem Solving Using C
Q9) Find the final values stored in the variables in following program segments :
(i) int x, y;
float a.b;
x = 1565/1000 + 2.7;
y= 1565/1000.0 +2.7;
a= 1565/1000+2.7;
b=1565/1000.0+2.7;
float a,b;
x = 12.6;
y= x + 0.5;
x= x-2;
y=y+1;
a=x+y -2.5;
b=a+x;
x = 025;
y=x+012;
float a, b;
https://sites.google.com/a/cmrit.ac.in/problem-solving-using-c/homework 2/12
9/11/23, 9:43 AM Question Banks - Problem Solving Using C
x = 12.6;
a = x + 0.5;
y= x = 0.5;
b= a +y;
Q11) (a) Define Algorithm. What are the characteristics of good algorithm? (or)
Give the distinct definitions of an algorithm.
Q1) With suitable examples, explain various unformatted console I/O functions.
Q3) Write a C function to swap the contents of two variables. Show how it is
called.
Q4) What do you mean by overflow and underflow of data ? Give examples in
each case.
https://sites.google.com/a/cmrit.ac.in/problem-solving-using-c/homework 3/12
9/11/23, 9:43 AM Question Banks - Problem Solving Using C
Q5) Write a note on (i) Bitwise operator (ii) Conditional operator (iii) Size of
operator (iv) logical operators.
Q6) What is the purpose of a “FOR” statement? Minimum how many times a for
loop will be executed? Compare FOR with WHILE and DO-WHILE statement.
Q8) Write a program to find the number and sum of 1s in a given binary
number.
Q9) Write a program to find the number and sum of all integers greater than
100 and less than 200 that are divisible by 7.
Q10) a) Compare the following pairs of statements: (i) Switch and nested-if-
else statement (ii) Break and Continue (iii) goto and Continue.
Q11) (a) M1,M2, M3 are the marks scored in 3 tests. Write an algorithm to find
the average of best 2 marks.
(b) Write a program to read the principal amount, period of deposit and
rate of interest. The program should compute the simple interest rounding
to nearest rupee without using if statements and built-in functions.
Q14) (a) Compare while and do-while loops. Give example for each.
https://sites.google.com/a/cmrit.ac.in/problem-solving-using-c/homework 4/12
9/11/23, 9:43 AM Question Banks - Problem Solving Using C
(b) Write a C program and draw flowchart to count the number of digits
and sum of digits in a given integer value.
Q15) (a) Explain the following with examples and flowchart: (i)
Simple if statement (ii) Nested if statement (iii) Else if ladder
(iv) switch statement.
Q18) Generate the prime numbers between the given upper and
lower bounds(upper bound > lower bound)
Q19) Write an algorithm and program for finding the biggest of 3 numbers.(using
ternary operator)
Q21) Write the different loop control structures available in C. Explain each one
of them briefly.
https://sites.google.com/a/cmrit.ac.in/problem-solving-using-c/homework 5/12
9/11/23, 9:43 AM Question Banks - Problem Solving Using C
main()
Q23) Write a program to find number of primes between integers m and n (m <
n). Also print the prime numbers.
Unit 3 : Arrays
Q1) What is an Array? Discuss how one dimensional array can be declared and
their elements are accessed?
Q4) (a) What are subscripted variables? How one and two dimensional
subscripted variables (arrays) are declared?
https://sites.google.com/a/cmrit.ac.in/problem-solving-using-c/homework 6/12
9/11/23, 9:43 AM Question Banks - Problem Solving Using C
(b) Write a program to reverse the contents of an integer array without
using another array.
Int x = 1234;
Float a = 12.6876;
Printf(“%8.2,f”, a);
Q8) Write a program to accept the two matrices A(M x N) and B(P x Q) and
verify whether they are multipliable. If multipliable, find the resultant
matrix C. Verify if the trace exists in C, if so, find the trace. (matrix
multiplication)
Q9) Write a program to sort the given list of numbers using selection sort.
Q10) Write a program to read data from keyboard, write it to a file called
“INPUT” , again read the same data from the “INPUT” file and display item
on the screen.
Q11) Explain any five string handling functions in C with appropriate examples.
Q12) Write a program to simulate strcat() function, without using any built-in
functions related to strings.
Q13) Write a program to compare two strings without using string handling
functions.
https://sites.google.com/a/cmrit.ac.in/problem-solving-using-c/homework 7/12
9/11/23, 9:43 AM Question Banks - Problem Solving Using C
Unit 4 : Functions
Q1) What are functions? How are they useful? What are the different kinds of
user defined functions and what is the need of user defined functions?
Q2) Write a C function to swap the contents of two variables. Show how it is
called.
Q3) With suitable example illustrate “call by value and call by reference”
techniques of passing parameters in (or)
Q4) Write a C function to swap the contents of two variables. Show how it is
called.
Q6) What are the different Categories of functions? Explain with example.
Unit 5 : Pointers
Q2) Write a program to find sum and average of elements stored in an array,
using pointers.
https://sites.google.com/a/cmrit.ac.in/problem-solving-using-c/homework 8/12
9/11/23, 9:43 AM Question Banks - Problem Solving Using C
Q4) Write a C program to find the largest of two numbers using pointers.
Q1) What are structures in C.? How are they different from unions? Give an
example for structure. (or)
Q2) Construct an array of structure called “student”. The data numbers are
name, USN, class grade and percentage mark. Read n records and conduct
“linear search” to print the details of the student, given a particular USN as
the key.
Q4) What are the unions? How are they different from structures? Give an
example for union.
Q5) Write a program that reads an array of structures named “STUDENT”. The
structure has three fields viz., name of the student, USN(alphanumeric
data), branch and grade(character data). Perform a linear search based on a
particular USN (key) and print the details of the student if available.
Employee id
Employee name
Date of joining
https://sites.google.com/a/cmrit.ac.in/problem-solving-using-c/homework 9/12
9/11/23, 9:43 AM Question Banks - Problem Solving Using C
Salary
Unit 7 : Files
Q3) Explain MALLOC () and CALLOC (), free (), realloc() functions. (or) Memory
allocation function using suitable examples.
Q4) Write a program that copies the content of one file into another.
Q5) Write a program to read data from keyboard, write it to a file called
“INPUT” , again read the same data from the “INPUT” file and display item
on the screen.
Unit 8 : Preprocessor
Showing 0 items
Č
Ċ 13MCA11-C-ques.pdf (141k) Unknown user, Jan 16, 2015, 4:08 AM v.1 ď
Ċ 13MCA11-C-solution.pdf (835k) Unknown user, Jan 16, 2015, 4:09 AM v.1 ď
ĉ 2ndinternal-cqpaper.docx (170k) Unknown user, Dec 1, 2014, 8:21 PM v.1 ď
ĉ 3rdinternal-qpaper-C.docx (170k) Unknown user, Dec 1, 2014, 8:22 PM v.1 ď
ĉ Answer Key -c-2ndinter-uploaded.docx (55k) Unknown user, Nov 14, 2014, 1:14 AM v.1 ď
ĉ Answer Key Template -c-3rdinteranl.docx (62k) Unknown user, Dec 1, 2014, 8:22 PM v.1 ď
ĉ Answer Key-i-inter.docx (91k) Unknown user, Dec 1, 2014, 8:49 PM v.1 ď
ĉ QUESTION_BANK-Cpgmming-new.docx (40k) Unknown user, Aug 7, 2014, 9:23 PM v.1 ď
Ċ prevqpapers.pdf (5371k) Unknown user, Aug 7, 2014, 10:13 PM v.1 ď
Comments
https://sites.google.com/a/cmrit.ac.in/problem-solving-using-c/homework 11/12
9/11/23, 9:43 AM Question Banks - Problem Solving Using C
Sign in | Recent Site Activity | Report Abuse | Print Page | Powered By Google Sites
https://sites.google.com/a/cmrit.ac.in/problem-solving-using-c/homework 12/12