0% found this document useful (0 votes)
3 views5 pages

22PCL13 Question Bank

The document outlines a comprehensive curriculum for a Programming in 'C' language course, covering five modules. Topics include the structure of C programs, data types, control statements, loops, arrays, strings, functions, preprocessors, structures, pointers, and file management. Each module contains specific learning objectives, programming tasks, and examples to facilitate understanding of C programming concepts.

Uploaded by

sanikaam660
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views5 pages

22PCL13 Question Bank

The document outlines a comprehensive curriculum for a Programming in 'C' language course, covering five modules. Topics include the structure of C programs, data types, control statements, loops, arrays, strings, functions, preprocessors, structures, pointers, and file management. Each module contains specific learning objectives, programming tasks, and examples to facilitate understanding of C programming concepts.

Uploaded by

sanikaam660
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Subject Name: Programming in ‘C’ language

Subject Code: 22PCL13/23


Semester: 1st& 2nd
Department: Computer Science and Engineering

Module-1
Introduction to C language and Decision making & Branching

1. Discuss "Structure of C Program" with an example.


2. Define C-tokens? List and explain in brief.
3. Define an identifier? What are the rules to construct an identifier? Classify the following as
valid/invalid Identifiers.
i) num2 ii) $num1 iii) +add iv) a_2 v) 199_space vi) _apple vii)#12
4. Define data types? List and explain types of datatypes.
5. Define Variable: Explain how to declare and initialise variables.
6. Explain the formatted input and output function.
7. Explain the following C operators with examples.
8. Implement a C program to find the Fibonacci number.
9. Explain Increment and Decrement operators with an Example.
10. Explain Arithmetic, Bitwise, and ternary operators (?:).
11. Define the precedence and associativity of operators. Explain with an example.
12. Evaluate the following C expressions step by step, showing the application of operator
precedence and logical evaluation.
10<9+5&&500*10, 4||5&&3&&!7
(8 + 2 * 3) > 15 || (20 / 5) && !(4 - 4)
13. Define type conversion? List and explain the types of type conversions with examples.
14. Implement a C program for the largest of 3 nos using if, else, and else if statements.
15. List and Explain Conditional control statements with an example.
16. Explain the Switch statement with a flowchart and example.
17. Define pseudocode. Implement pseudocode to find the sum and average of the given
three numbers.
18. Implement a C program that takes three coefficients (a, b, and c) of a quadratic equation
(ax2+bx+c) as input and computes all possible roots and prints them with appropriate messages
19. Explain the following operators in the C language
i) Relational ii) Logical iii) Conditional
20. Draw the flowchart and implement a C program to compute simple interest.
21. Convert the following mathematical expressions into their equivalent C programming statements.

Module-2
Looping and Arrays

1. Discuss the following with syntax, flowchart and programming example.


a) while loop b) do while loop
2. Discuss the differences between break and continue statements.
3. Explain Various ways of Initializing arrays.
4. Define a goto (unconditional) statement? Discuss with an example.
5. Explain Unconditional Control statements with examples.
6. Write the C programs for the following.
To check whether the year is a leap year or not a leap year.
To check whether the number is a PALINDROME or NOT a PALINDROME
7. Define a one-dimensional array? Explain its declaration and initialization with syntax and
examples.
8. Implement a C program to find the sum of Positive and negative numbers and their average.
9. Define Linear search and implement an algorithm with an example.
10. Define Binary Search, explain with an example.
11. Implement the Bubble sort algorithm with a Program.
12. Define a two-dimensional array? Explain its declaration and initialization with syntax and an
Example.
13. Develop a C program that reads N integer numbers and arranges them in ascending order using
selection Sort.
14. Implement a C program to read N numbers into an array & perform Linear search
15. Define looping? Briefly explain the for loop with an example.
16. Implement a program to find the sum of the digits of a number using a while loop.
17. Implement a C program to add two matrices of size m × n.
18. Implement a program to multiply two matrices. Explain the logic briefly.
19. Implement a program to check whether a number is prime or not using any loop.

20. Define a recursive function? Write a recursive function to find the factorial of 'n'.

Module-3
Strings and Functions

1. Define a string? Explain its declaration and initialization with syntax and example.
2. Define string. List out all string manipulation functions. Explain any two with Example
3. Write the C programs for the following.
To find the length of a string without using a built-in function.
To reverse a String without using a built-in function.
4. Explain unformatted input functions with an example.
5. Define a function and explain with syntax.
6. Define a string? Implement a C program that reads a sentence and prints the frequency of each of
the vowels and the total count of consonants?
7. Difference between actual parameter and formal parameter.
8. Explain 'call by value' and call by reference' (call by address)
9. Write a C program to swap two values using a defined function to swap two values (call by
reference).
10. Define a function. explain the following with an example.
a. function with parameters and return values.
b. function with no parameters and return values.
11. Implement a C program to copy a string (combination of digits and alphabet) to another string
(only alphabets) that copies string str1 to another string str2 without using a library function
12. Write C program to swap two values using defined function to swap two values. (call by
reference)
13. Implement a program to find the factorial of a number using a user-defined function.
14. Explain nested functions (function calling another function) with a sample program.
15. How are arrays passed to functions? Implement a program to find the sum of the array elements
using a function.
16. Explain the following with an example.
a. function with parameters and No return values.
b. parameter-less function.
17. Implement a C program to convert uppercase to lowercase without using strupr () and strlwr ().
18. Implement a C program to concatenate two strings without using strcat ()
19. Implement a C program to find the length, compare, and concatenate strings using the
parameter passing method.
20. Explain unformatted output functions with an example.
Module-4
Preprocessors and Structures

1. Define a Preprocessor directive explain the types of preprocessor.


2. Define structure? Explain the C syntax of structure declaration with an example
3. How are unions declared and used? Compare structures and unions in terms of memory usage and
functionality with examples.
4. Explain the array of structure and structure within a structure with an example
5. Discuss 'structure and functions' with an example.
6. Explain with an example how to create a structure using “typedef”
7. Write C program to read and display 'n' students information (Roll No, Name, Marks, Grade)
using arrays of structures.
8. Explain conditional compilation with an example program.
9. Define a structure in C. Explain how a structure is declared, initialized, and accessed.
10. Explain copying and comparing structure variables. Why can't we compare structures using
`==`?
11. Define a macro? Implement a macro to determine whether the given number is odd or even.
[Link] conditional compilation with an example program.
13. Explain the advantages and disadvantages of using macros.
14. Define an array of structures? Implement a program to store and display information of 5
employees.
15. What are nested structures? Implement a program to demonstrate structure within structure.
16. Explain union declaration and initializations. Implement a program showing how a union stores
only one value at a time.
Module-5
Pointers and File Management

1. Define a pointer? Explain how the pointer variable was declared and initialized?
2. Define dynamic memory allocation. Explain the following functions with an example.
malloc (), calloc (), realloc (), free ()
3. Explain how pointers and arrays are related with an example
4. Explain Pointer and Structure with an example.
5. Define a File and explain the steps using the files.
6. Explain how to open a file and close a file with syntax and an example.
7. Explain the input and output operations of a file with syntax.
8. Explain ftell () with syntax and implement a program using ftell () random-access file.
9. Implement a C program using pointers to compute the Sum, Mean and Standard deviation of all
elements stored in an array of n real numbers.
10. Implement a C Program to read a string from a file and write it into an output file.
11. Implement a program to copy the contents of one file to another using file I/O functions.
[Link] the difference between text files and binary files. Implement a program to read a binary
file using `fwrite()` and `fread()`.

13. Explain pointer arithmetic. How do operations like `ptr++`, `ptr--`, `ptr + n` work?
14. Implement a C Program to first read from the file and then append the data of the file.
15. Define pointers to strings? Implement a program to display a string using a character pointer.
16. Explain Input and output functions for characters with an example
17. Explain fseek () and rewind () with syntax and implement a program using fseek () random-access
file.

****************

You might also like