Question Bank BESCK204E
Question Bank BESCK204E
Question Bank BESCK204E
Module 1:
1. Explain the basic structure of C with example. Explain each section briefly.
2. Define variable. Explain the rules for constructing variables in C language.
3. Write a C program to compute simple interest. Draw the flowchart for the same.
4. Define data type. Explain primitive data types supported by C with example.
5. List all the operators used in C language and evaluate the following expressions.
a. x = a – b / 3 + c * 2 – 1 when a=9, b=12, c=3
b. 10 != 10 || 5 < 4 && 8
6. Describe the various types of computers.
7. With a neat block diagram of a computer, explain its components.
8. Classify the following into input and output devices:
Monitors, Visual Display Unit, Track balls, bar code reader, digital camera, film recorder,
microfiche, OMR, Electronic whiteboard, Plotters.
13. What is a token? What are different types of tokens available in C language? Explain.
14. Write an algorithm and program to find biggest of three numbers.
15. What is an algorithm? Write an algorithm to find largest of 3 numbers.
16. Explain two types of type conversions with examples.
17. Write a C program to swap two numbers
a. using third variable
b. without the third variable
18. Write a note on Operator precedence and associativity.
19. Write a C program to find area of a circle for the given radius and draw a flowchart for the same.
20. Convert the following into C-equivalent expression.
21. Convert the following into C expressions:
x y
a. +
b+c b−c
b (ad +e ) c
b. a+ −
b−a d
22. What is the value of ‘x’ in the following code segments? Justify your answers:
a. b.
23. Write a C program to find the largest of three numbers using ternary operator
24. Evaluate the following expressions:
a. 100 % 20 <= 20 – 5 + 100 % 10 – 20 == 5 >= 1 != 20
b. a += b *= c -= 5 where a=3, b=5 and c=8
25. Write a C program to find the area and perimeter of a rectangle.
26. Write a C program which takes p, t, r as input and computes the simple interest.
27. Write a C program to find the factorial of a given number using do-while.
Module 2:
1. Explain the formatted I/O functions of C language with syntax and example.
2. Write a C program to implement commercial calculator using switch statement.
3. Write the syntax of different branching statements and explain their working.
4. Differentiate between while and do-while loop. Explain the syntax and example.
5. Write a program to find the sum of N numbers using for loop.
6. Write a C program to plot Pascal’s triangle.
7. Define and write the classifications of input and output statements in C. Write a C program that
prints the following output: “I am
an” ‘Engineering
Student’
8. Define branching statements. Explain them with syntax and suitable example.
9. Evaluate
i = 1;
L: if ( i > 2)
printf(“Saturday”);
i = i – 1;
goto L;
printf(“Sunday”);
10. State the drawback of else-if ladder. Explain how you resolve with suitable example.
11. Write a C program to get this triangle of numbers as a result.
12
123
1234
12345
201 – 400 Rs. 100 + Rs. 0.65 per unit excess of 200
401 – 600 Rs. 230 + Rs. 0.80 per unit excess of 400
601 – above Rs. 390 + Rs. 1.00 per unit excess of 600
Module 3:
1. Define array. Write the syntax for declaration and initialization of 1D and 2D array with suitable
example.
2. Write a C program to find the transpose of a given matrix.
3. Define string. List out all the string manipulation functions. Explain any two with examples.
4. Write a C program for (consider integer data)
a. Bubble Sort
b. Linear Search
c. Binary Search
5. Write a C program to copy a string (combination of digits and alphabets) to another string (only
alphabets)
6. Write a C program to find sum of array elements by passing array as function argument.
7. Write a C program to concatenate two strings without using built-in function strcat().
8. Write a C program to implement the string copy operation strcpy(str1, str2) that copies a string
str1 to another string str2 without using library function.
9. Explain the importance of strcmp() and strcat() string manipulation functions.
10. Write a C program to find the length of a string without using strlen() function.
11. Write a C program to replace each constant in a string with the next one except letters ‘z’, ‘Z’,
‘a’, ‘A’. Thus the string “Programming in C is fun” should be modified as “Qsphannjoh jo C jt
gvo”.
12. Write a C program that reads a sentence and prints the frequency of each of the vowels and total
count of counts of consonants.
13. Explain with examples the difference between gets() and puts() function.
Module 4:
1. What is a function? Explain the different types of functions based on parameters and return types.
2. Write a C program to find the factorial of a given number using functions.
3. Write a program to find GCD and LCM of two numbers using functions.
4. Explain recursion and write a program to find the nth term of the Fibonacci series.
5. Give the scope and lifetime of the following:
a. External variable
b. Static variable
c. Automatic variable
d. Register variable
6. Write a C program for evaluating the binomial coefficient using a function factorial(n)
7. Write a C recursive function for multiplying two integers where a function call is passed with two
integers m and n.
8. Differentiate:
a. User- defined and built-in function
b. Recursion and iteration
9. Write a C function isprime(num) that accepts an integer argument and return 1 if the argument is
a prime or a 0 otherwise. Write a program that invokes this function to generate prime number
between a given range.
10. Write a program using functions to swap 2 numbers using call be reference method.
11. Explain the following with syntax and example
a. Function declaration
b. Function definition
c. Function call
12. Write a C program to search for an element in the given array using Linear Search by passing
array as an argument.
Module 5:
1. What is a structure? Explain the syntax of structure declaration in C with example/Explain how
do you declare, initialize and represent the memory for structure variable.
2. Write note on
a. arrays within structure
b. array of structures
3. Implement structures to read, write and compute average marks and display students scoring
above average and students below average for a class of N students.
4. What is a pointer? Show how pointer is declared and initialized.
5. Explain any 2 preprocessor directives in C
6. Write a C program to find sum and mean of all elements in an array using pointer.
7. Write a C program that accepts a structure as a parameters to a function from a function call.
8. Define pointers. Explain pass by value and pass by reference with C statements and an example.
9. Write a C program that finds the addition of two squared numbers, by defining macro for
Square(x).
10. Explain typedef with suitable example.
11. Give advantages and disadvantages of pointers in C.
12. Write a C program using pointers to find the sum, mean and standard deviation of all elements
stored in an array of n real numbers.
13. Create a structure that contains student name (sname) and student marks (smarks). Write a C
program which reads name and marks of two students and compares whether both students are
the same.
14. Mention syntax and give an example for the following:
a. Structure definition
b. Structure variable definition
15. Mention the significance of compiler control pre-processor directives.
16. Write a C program to maintain record of n employee details using array of structures with three
fields (id, name, salary) and print details of employees whose salary is greater than 5000.