Question Bank C
Question Bank C
Module 1
1. What is a computer? Write the characteristics of computer.
2. With a neat diagram explain the basic structure of a computer.
3. Write a structure of a C program with an example.
4. Define the following terms with an example
i. Algorithm
ii. Flowcharts
iii. Pseudo code
5. What are variables and how they are declared and initialized with an example.
6. Summarize the C program rules to declare variables/identifier with suitable examples.
7. Write a C program to demonstrate the use of printf and scanf statements to read and
print values of variables of different data types.
8. Explain different types of computers.
9. What is Software? Explain different types of software.
10.What is a token? What are the different types of tokens available in C language?
Explain.
11.What is an operator? Explain different types of operator with examples.
12.Evaluate the following expressions:
i. x = a + b * a % (c * a) / 2 + d % c – b.
ii. y = (a + b) / c – d * e
where, a = 12, b = 8, c = 8, d = 7, e = 5
Module 2
1. Explain the syntax and working of switch case statement. Write a C program to
determine whether an entered character is Vowel or not.
2. Develop a C program to find the largest of three numbers using ternary operator.
3. Develop a program to convert an integer into the corresponding floating point number
using Type casting.
4. Demonstrate the working of break and continue statement with suitable example.
5. Explain the relation and logical operators with programming examples.
6. Compare the working of for, while and do while or iterative statements along with
their Syntax.
7. Explain if, if-else, nested if-else and cascaded if-else or conditional statements with
examples and syntax.
8. Differentiate while and do while with simple programming example.
9. Write a C program to find the factorial of a given number using for loop.
Dept. of CSE 1
Introduction to C_Question Bank
Module 3
1. What is recursion? Develop a C program to print Fibonacci series using recursion.
2. How 1D integer array is represented in memory. With the help of suitable example
demonstrate the initializing the element.
3. Distinguish between Call by Value and Call by Reference using suitable example.
4. Define function? Develop a C program to add two integers using functions
5. Define storage class explains the different storage classes supported by C.
6. What is the function? Explain different classification of user defined functions based
on parameter passing and return type with examples.
7. Define recursion. Explain the advantages of recursion.
Module 4
1. How 2D array is represented in memory. Explain with suitable example.
2. Develop a C program to sort the given set of N numbers using bubble sort
3. What are strings? Mention the reading strings and writing strings along with their
Syntax.
4. Develop a C program to implement matrix multiplication and validate the rules of
multiplication.
5. Explain the applications of arrays in C.
6. Develop a C program to print the following pattern.
H
HE
HEL
HELL
HELLO
HELLO
HELL
HEL
HE
H
#include <stdio.h>
int main()
{
int i,j;
char c[]="HELLO";
for(i=0;i<sizeof(c)-1;i++)
{
Dept. of CSE 2
Introduction to C_Question Bank
for(j=0;j<=i;j++)
{
printf("%c ",c[j]);
}
printf("\n");
}
//printf("\n");
for(i=0;i<sizeof(c)-1;i++)
{
for(j=0;j<sizeof(c)-1-i;j++)
{
printf("%c ",c[j]);
}
printf("\n");
}
return 0;
}
Module 5
1. What is a pointer? Explain how the pointer variable declared and initialized.
2. Using suitable code, Discuss the working of the following string functions
• strcat
• strlen
• strstr
• strcmp
3. Develop a C program to concatenate two strings without using built-in function.
4. Develop a program using pointers to compute the Sum, Mean and Standard deviation
of all elements stored in an array of N real numbers.
5. Define structure? How structure is declared and initialized.
6. Explain structure within a structure with an example.
7. Develop a C program to implement structures read, write and compute average marks
and the students scoring above and below the average marks for a class of N students.
8. Explain any five string manipulation functions.
9. Develop a C program to read and display the information consisting of Roll Number,
Name, Age and Marks of ‘N’ students in a class.
Dept. of CSE 3