Module 2
Question Bank
January 2024
1. Explain the syntax of ternary operator in C. Write a program for evaluating the function Y
using ternary operator.
(3 Marks)
2. Give the syntax of switch statement. Write a program to check whether a given number is
positive, negative or zero using switch. (3 Marks)
3. With suitable examples describe the conditional statements in C. (8 Marks)
4. Write a C program to check whether a given number is perfect or not (A perfect number is a
positive integer that is equal to the sum of its factors excluding the number itself). (6 Marks)
5. Explain different operators in C. (8 Marks)
6. Write a C program to check whether a counting number is prime or not. (6 Marks)
June 2023
1. Write the difference between ‘while’ and ‘do -while’ statements. (3 Marks)
2. Explain various formatted I/O statements in C. (3 Marks)
3. Explain any four types of operators used in C. (7 Marks)
4. Write a program to generate the following pattern.
(7 Marks)
5. Implement string concatenation without using built in functions. (8 Marks)
6. Write a C program to accept a 2-D integer matrix and check whether it is symmetric or not ( A
matrix ‘A’ is symmetric if A=AT). (6 Marks)
June 2022
1. Differentiate between while and do-while loops using an example. (3 Marks)
2. Why is the use of goto statement discouraged in C programs? (3 Marks)
3. Explain different data types supported by C language with their memory requirements. (7
Marks)
4. Write down a C program to check if a number is present in a given list of numbers. If present
give location of the number otherwise insert the number in the list at the end. (7 Marks)
5. Explain formatted and Unformatted I/O functions of C language with syntax and example. (7
Marks)
6. Write a C program to read a character from the user and check whether it is a vowel or
consonant. (7 Marks)
July 2021 (FN)
1. What is the importance of precedence and associativity? Write the table for operator
precedence. (3 Marks)
2. Differentiate between ‘break’ and ‘continue’ statements. (3 Marks)
3. Explain different data types supported by C language with their memory requirements. (7
Marks)
4. Write a C program to check if a number is present in a given list of numbers. If present, give
location of the number otherwise insert the number in the list at the end. (7 Marks)
5. Write a C program to find the sum of first and last digit of a number. (7 Marks)
6. What is type casting? Name the inbuilt typecasting functions available in C language. What is
the difference between type casting and type conversion? (7 Marks)
July 2021 (AN)
1. What is the difference between assignment and equality operators? (3 Marks)
2. What is a static variable? When should it be used? (3 Marks)
3. Explain arithmetic, logical and bitwise operators with examples. (7 Marks)
4. Write a C Program to check if a given number is a strong number or not. A strong number is a
number in which the sum of the factorial of the digits is equal to the number itself. Eg:-
145=1!+4!+5!=1+24+120=145 (7 Marks)
5. Write a C program to convert the given decimal number into binary number. (7 Marks)
6. What do you mean by Formatted Input? Explain in detail the prototype of ‘scanf()’ function in
C including its argument list and return type. (7 Marks)