0% found this document useful (0 votes)
3 views

Cpps Qb@Azdocuments - in

Uploaded by

punitkamatar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Cpps Qb@Azdocuments - in

Uploaded by

punitkamatar
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

CBIT, KOLAR Page 1 of 5

TUTORIAL QUESTIONS
SUBCODE: 18CPS13
SEMESTER: I SUBJECT: C PROGRAMMING FOR PROBLEM SOLVING

MODULE 1
1 With a neat block diagram of computer, explain its components.

2 Explain LAN, WAN, MAN, Network.

3 Define: Hub, Switch, Registers, Cache, Constant, Declaration and Ports.

4 Define topology. Explain its types.

5 Explain any two input and two output devices.

6 What is software? Explain its types.

7 What is a Computer? Explain the generations of computer.

8 Describe the various type computers.

8 Differentiate between Primary memory and Secondary memory, SRAM and DRAM.

9 Define a variable. Explain the rules for constructing variables in C language.

10 Define data type. Explain primitive data types supported by C languages with example.

11 Write the basic structure of C program. Explain each section briefly with suitable example.

12 Define operator. Explain any 6 operators with suitable example.

13 What is a token? What are different types of tokens available in C language? Explain.

14 Write a C program to compute simple interest. Draw the flowchart for the same.

Define:
i. Variable and give the rules for declaring it.
15
ii. Constant
iii. Declaration.
Evaluate each of the following expression independent of each other.

i. x = a – b/3 + c * 2 – 1 where, a=9, b=12, c=3


ii. 10 != 10 || 5 < 4 && 8
iii. 100%20 <= 20 – 5 + 100 % 10 – 20 = = 5 >=1 != 20
16 iv. a += b * = c - = 5 where, a = 3, b=5 and c=8
v. int i=3, j=4, k=2
a) i++ - j
b) ++k % --j
c) j+1/i-1
d) j++/i--
CBIT, KOLAR Page 2 of 5

vi. 22+3 < 6 && !5 || 22 == 7 && 22-2 > +5


vii. A+2 b || !c && a ==d*a-2<=e where, a=11, b=6, c=0, d=7 and e=5

Classify the following into input and output devices:


17 Monitors, Visual display unit, Track balls, Barcode reader, Digital camera, Film recorder,
Microfiche, OMR, Electronic Whiteboard, Plotters.

State whether the following are valid identifiers or not:


18
integer, float, Iam, 123_ABC

Convert the following mathematical expressions into ‘C’ expressions:


i) X = e power root of(x) + e power root of(y)/xsin root(y)
ii) C = a*a+1/((b+1)/(c+d))
iii) C = 3 root of((a*a*a+b*b*b*b)/(a*a*a*a-b*b*b))
19 iv) Area = ((pie*r*r) + (2*pie*r*h))
v) Area = πr2 + 2 π rh
−𝑏+ √𝑏2 −4𝑎𝑐
vi) x= 2𝑎
𝑦
vii) m = 𝑥 4 + √𝑥 + 𝑘
− 4𝑥 + 6

MODULE 2
1 List the difference between While and do while loop. Explain with syntax and example.

2 Explain for loop with syntax, flowchart and example.

3 Explain the working with syntax of different branching statements used in C

4 Explain the working with syntax of different looping statements used in C

5 WACP for: Binomial coefficient and Pascal Triangle.

6 Explain formatted input and output statement with examples.

7 Explain unformatted input and output statement with examples.

8 Show how break and continue statements are used in a C-program, with example.

9 Write a note on goto statement.

10 State the drawback of ladder if-else. Explain how do you resolve with suitable example.

WACP to get the triangle of numbers as a result:

11 1
1 2
1 2 3
1 2 3 4
12 Write a C program to implement commercial calculator using switch statement.

13 WAP to find the sum of N natural numbers using for loop.


CBIT, KOLAR Page 3 of 5

WAP to find sum of natural numbers from 1 to N using while loop.

WAP to find sum of odd numbers from 1 to N using do-while loop.

State the drawback of ladder if-else. Explain how do you resolve with suitable with suitable
14
example.

15 Write a C program to check whether given number is prime or not.

16 Write a program to check whether a given integer is palindrome or not.

Write a program in C to display the grade based on the marks as follows:

Marks Grades
0 to 39 F
17 40 to 49 E
50 to 59 D
60 to 69 C
70 to 79 B
80 to 89 A
90 to 100 O
Evaluate:

i=1
l : if(i>2)
{
18 printf(“saturday”);
i = i-1;
goto l;
}
printf(“sunday”);
Explain your result briefly.

19 WACP to check whether a given number is even or odd using if-else statement.

Write a C program that prints the following output:

20

21 WACP to find all possible roots of quadratic equation and print them with appropriate messages.

MODULE 3

1 Define array. Write the syntax for and with declaring and initializing 1D and 2D array with
suitable example.
2
Define String. List out all string manipulation function and explain them.
CBIT, KOLAR Page 4 of 5

3
WACP: Linear Search, Binary Search, Selection Sort, Bubble Sort.
4
WACP to copy a string (combination of digits and alphabets) to another string (only alphabets).
5
WACP to find transpose of a given matrix.
6
WACP to concatenate two strings without using built in function.
7
How string is declared and initialized? Explain string input/output functions with an example.
8
Write a program to multiply 2 matrices, by ensuring their multiplication compatibility.
9
Write a C program to find the transpose of a given matrix.
10 Write a C program to copy a string (combination of digits and alphabets) to another string (only
alphabets).
11
WACP to find biggest of n numbers using arrays.
12
List the difference between Linear Search and Binary Search.

MODULE 4
1
What are C-functions? What are the advantages of user defined functions ?
2
Explain the different elements of user defined functions in detail.
3
List and explain the categories of user defined functions.
4
Define Recursion. Give any two limitations of recursion.
5
WACP to compute the factorial of a given number ‘n’ using recursion.
6
WACP to compute the Fibonacci series using recursion.
7
Differentiate between pass by value and pass by reference with examples.
8
Write a program to find GCD and LCM of two numbers using concept of functions.
Give the scope and lifetime of following:
11) External variable
9
ii) Static variable
iii) Automatic variable
iv) Register variable.
10
WACP using recursive function for Binary to Decimal Conversion.
11 Write a C recursive function for multiplying two integers where a function call is passed with
two integers m and n.
Differentiate:
12
i. User defined and built-in function
ii. Recursion and iteration
13 Write a C-program for evaluating the binomial coefficient using a function factorial(n).
CBIT, KOLAR Page 5 of 5

WAP in C using functions to swap two numbers using global variables concept and call by
14
reference concept.

15 WACP to find the largest element in an array.

16 List the storage class specifiers. Explain any one of them.

MODULE 5

1 Define structures. Explain how do you declare, initialize and represent the memory for structure
variable.
2
Define pointer. Explain how to declare and initialize pointers with syntax and example.
3
Define pre-processor directives. List its types and explain them.
4
WACP that finds the addition of two squared numbers, by defining macro for square(x).
5
WACP that accepts a structure variable as a parameters to a function from a function call.
6 Write a note on: i) Arrays within structures ii) Array of structures iii) Structure within structure
iv) Array of pointers
7
Write a C program to add two numbers using pointers.
8 Write a C program that finds the addition of two squared numbers, by defining macro for
Square(x).
9 Write a C program that accepts a structure variable as a parameters to a function from a function
call.
10 Explain why do you need nested structures?

11 Differentiate between structures and unions.

WACP to maintain record of n students using structures with 4 fields (Rollno, marks, name
12
and grade). Print the names of students within marks >= 70.

You might also like