0% found this document useful (0 votes)
7 views13 pages

CS3251-Programming in C-Question Bank

The document outlines the syllabus for a C programming course at the Global Institute of Engineering and Technology, covering topics such as basics of C programming, arrays, and strings. It includes both theoretical concepts and practical programming exercises, with a focus on data types, operators, control structures, and string manipulation. Additionally, it provides a series of questions and programming tasks for students to practice and demonstrate their understanding of the material.

Uploaded by

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

CS3251-Programming in C-Question Bank

The document outlines the syllabus for a C programming course at the Global Institute of Engineering and Technology, covering topics such as basics of C programming, arrays, and strings. It includes both theoretical concepts and practical programming exercises, with a focus on data types, operators, control structures, and string manipulation. Additionally, it provides a series of questions and programming tasks for students to practice and demonstrate their understanding of the material.

Uploaded by

Sneha.j Sneha.j
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 13

GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY

(Approved by AICTE, Affiliated to Anna University, Chennai)


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C

UNIT I BASICS OF C PROGRAMMING 9


Introduction to programming paradigms – Applications of C Language - Structure of C program -
C programming: Data Types - Constants – Enumeration Constants - Keywords – Operators:
Precedence and Associativity - Expressions - Input/Output statements, Assignment statements –
Decision making statements - Switch statement - Looping statements – Preprocessor directives -
Compilation process.
PART-A
1. What are tri graph characters? JAN 09
2. Is “main “a keyword in C language. MAY 11
3. List the rules for defining variables in c JAN 09
4. What are variables? Give examples. MAY 16
5. What do you mean by C Tokens? JAN 12
6. What is an identifier? Give examples.
7. List out the rules to be followed in formatting an identifier. MAY 10
8. What are the main features and application of c language? JAN 11
9. Define with an example integer and floating type of data in c language. JAN 11
10. What is meant by ternary operator? Give an example. JAN 09, MAY 11 NOV 14
11. What is bitwise operator in C .JAN 11
12. Categorize the operators used in C. JAN 11
13. Give two examples for logical and relational expressions JAN 11
14. What are the various test functions used in C language?
15. Write a for loop statement to print numbers from 10 to 1. JAN 14
16. What is meant by entry controlled loop?
17. Mention the use of break and continue statement. Or Differentiate break and continue statement in C
language. NOV/DEC 19
18. Write a code segment using while statement to print numbers from 10 to 1. JAN 10
19. What is the significance of while statement in C? Give a typical format of it. JAN 11
20. Define a structural programming language. JAN 11
21. Write the limitations of using getchar() and scanf() functions .
22. Differentiate do while loop and while loop. JAN 11, 13, NOV 17
23. list the different data types in C. MAY 14
24. Define implicit type conversion. MAY 16
25. Write a c program to find biggest among 2 numbers.
26. Write a c program to find factorial of a given number using iteration. MAY 14
27. What is a variable? Illustrate with example. NOV 14
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C
28. What is the importance of Keywords in C? MAY 15
29. List the various input and output statements in C. MAY 15
30. What is compilation process? NOV 15
31. Explain the working of modulo operator. NOV 15.
32. What is the use of size of () operator? NOV 17
33. What storage classes are available in C language? NOV 17
34. How does a preprocessor work? APRIL/MAY 18
35. What is the use of preprocessor directives? APRIL/MAY 19
36. Differentiate between formatted and unformatted input statements. Give one example for each.
APRIL/MAY 19
37. Define in C++.Define ‘Structure’ of C language. Give an example.
38. List the various types of operators in by C. NOV/DEC 19
39.What is an algorithm? NOV/DEC 19
40.What is flow chart? NOV/DEC 19
41. What are the data types available in C? NOV/DEC 19
42. Differentiate between While statement from Do... While statement. NOV/DEC 19

PART-B
1. Differentiate between signed and unsigned integer. JAN 10, MAY 12.
2. Explain the Structure of a c program.What is the advantages & applications of c language? JAN 11,
NOV/DEC 19
3. Explain the different data types in C with Example. JAN 13, MAY-09,10, 16
4. What is meant by operator Precedence? Discuss its impact in the programming with suitable example.
JAN 09
5. Describe various types of operators in by C. Discuss each of them with suitable examples JAN 11,13,
NOV 14,15 ,MAY 11, 15, 16, NOV 17, APRIL/MAY 18, NOV/DEC 19
6. (i) Differentiate between operand and operator with an example.
(ii) Discuss about bitwise operator and logical operators in C JAN 13
7. Write a C program for the following expression JAN 10
(i) a=5<=8 &&6!=5
(ii) a=b++ ++b where b=50
8. Explain with an example formatted and unformatted I/O statements. JAN 12, MAY 10, 16
9. Explain various decision making structures with illustrative examples. JAN 13, MAY-09,10, NOV 15,
NOV 17 or Describe the decision making statements in C with an Example. APRIL/MAY 18,
NOV/DEC 19
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C
10. Explain about Branching and looping with example. JAN 11, MAY 11,12,14, NOV 17, APRIL/MAY
18, APRIL/MAY 19, NOV/DEC 19
11. Explain in detail about managing input and output operators. JAN 11
12. Explain any four format strings with an example. JAN 13
13. Explain the program control structures with suitable examples JAN 09, NOV 17
14. How does a switch statement differ from if statement? Explain with an example. JAN 09, NOV/DEC21
15. Explain the following conditional statements JAN 10, 11
(i) If-else statement
(ii) Nested If-else statement
(iii) Switch statement JAN 13, MAY-09,10
16. Write a c program to determine the given number is odd or not using If-else statement. JAN 11
17. Explain the various syntaxes for performing the branch and looping process. JAN 12
18. (i)Explain any four format string with examples. JAN 13
(ii)Write the syntax of “for construct” in c. Give an example. JAN 13
19. Writ a c program to display a pyramid structure using numbers. MAY 12
20. Write a c program that reads a character and display only vowels using Switch case structure. MAY 12

Write a C program to evaluate the following series .JAN 12, MAY 10

21. Write a C program that Computes and prints a table of Factorial for a given Integer. MAY 10
22. Write a C program to check given number is a prime number or not. JAN 10, June 14
23. (i)Write a C program to print the Fibonacci series of a given number. JAN 09
24. (i)Write a C program to find number of vowels in a string
25. (ii)Write a C program to find number of sentences, words and characters in a given paragraph. JAN 13,
MAY-09,10
26. Write a C program to explain about ternary operator.
27. Write a C program to find the factorial of the given number.
28. Write a C program swap 2 numbers without using third variable.
29. Write a C program to display the sum of n numbers. MAY 09,10 or Write a C program to print sum of
10 non negative numbers entered by the users. APRIL/MAY 19
30. Write a C program to to find the largest among 3 numbers entered by the user. APRIL/MAY 19
31. Explain about increment and decrement operator with an example.
32. Write a C program to find the area of circle and to solve quadratic equation. MAY 14
33. Write a C program to reverse a string without using string reverse function. MAY 09,10
34. Write a C program to check whether the given number is Armstrong number or not. JAN 10
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C
35. Explain the various looping constructs. Give an example for each and explain the working of the
construct.JAN 09, NOV 14 , MAY 15
36. What are constants? Explain the various types of constants in C. MAY 15
37. Write a C program to solve the quadratic equation. MAY 15
38. Write a C program for the following series: 1+2+3+4+………+n. MAY 16
39. Write a C program to check the integer is Palindrome or not. APRIL/MAY 18
40. (i) Explain iterative statement in ‘C’ with an example. (8) NOV/DEC 21
(ii) Discuss pre-processor directives with example program. (8) NOV/DEC 21
41. i. Explain enumeration constants with an example program. NOV/DEC 21
ii. Write a ‘C’ program to compute student grades using switch case statement. The input to be
program are marks of 5 subjects, compute the total and average and find respective grade of
the students. NOV/DEC 21
Grades>90 ‘S’ 80-90 A 70-79 B 60-69 C 50-59 D 40-49 E <40 F
42. Explain various operators in C Language in detail. NOV/DEC 21
43. Explain various input and output functions of C language in detail. NOV/DEC 21

UNIT II ARRAYS AND STRINGS 9


GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C

Introduction to Arrays: Declaration, Initialization – One dimensional array – Two dimensional


arrays - String operations: length, compare, concatenate, copy – Selection sort, linear and
binary search.

PART-A
1. Define array/what is an array JAN 14, MAY 15,16
2. How to declare an array?
3. What are the types of arrays?
4. What are the main elements of an array declaration?
5. How to initialize an array?
6. Why is it necessary to give the size of an array in an array declaration
7. What is the difference between an array and pointer?
8. Differentiate one dimension array and two dimension array.
9. Declare a character array of size 5 and assign vowels to it NOV 15
10. Explain two dimension arrays? JAN 11
11. Write the syntax for initializing a one dimension array and two dimension arrays?
12. Write the syntax for accessing single dimensional array and dimension arrays?
13. Write example code to declare two dimension arrays. June 14
14. Define multi dimension arrays.
15. Write any four features of array JAN 13, NOV 17
16. What is meant by character array?
17. What are the advantages and disadvantages of an array?
18. Define string. Give examples. MAY 16
19. How string variables are declared?
20. How strings are represented in C language JAN 10
21. Give some examples of string functions.NOV 15
22. What are the string manipulation functions?
23. List any four string handling functions? MAY 14
24. What is the use of atoi() function?
25. What is the use of ‘typedef’’?
26. Name any two library functions used for string handling JAN 14
27. What is the use of strlen (), strcpy(), strcat(), strcmp(), strrev(),strstr().
28. What is meant by string concatenation?
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C
29. How string comparison is done?
30. Define insertion sort.
31. Explain selection sort.
32. Define Searching?
33. What is linear search and binary search?
34. Give an example for initialization of string array. NOV 14
35. How is a character string declared? Apr/MAY 15
36. Differentiate between Linear search and Binary search. NOV 17
37. What is an array? Apr/May 2018
38. Design a C program compare any two string. Apr/May 2018
39. Define array. NOV/DEC 19
40. Name any two library functions used for string handling. How is a character string
declared?
NOV/DEC 19

PART-B
1. Define arrays. Explain the array types with an example program for each type.
2. Write a C program to convert the given string from lower case character to upper case character and
upper case character to lower case character. MAY 11
3. Write a C program to find largest and smallest in a matrix MAY 10, NOV 15
4. Write a C program to arrange the numbers in ascending order. June 14
5. Write a C program to count the letters in a sequence of characters. JAN 13
6. Write a C program to count the number of vowels in your name. MAY 16
7. Write a C program to print the given numbers in reverse order.
8. Briefly explain the various strings handling function in C. June 10, MAY 15
9. Write a C program to reverse a given string. MAY 11
10. Write a C program to concatenate two strings. MAY 09
11. Write a C program to check whether the given string is palindrome or not. MAY 16
12. What is meant by selection sort? Explain in detail with an example.
13. Write a C program to sort the given set of numbers in ascending order. JAN 11, 13, NOV 14
14. Write a C program to arrange the given 10 numbers in descending order. MAY 16
15. What is linear search? Write a C program to search an element from an array using linear search
16. What is Binary search? Write a C program to search an element from an array using Binary search?
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C
17. Write a C program to find the addition of two matrices. JAN 13, 14
18. Write a C program to subtract two matrices and display the resultant matrix. MAY 14
19. Write a C program to find the multiplication of two matrices. MAY 15, 16, NOV 14, 15, 17
20. Explain the various string operations. Write a C program to find the length of a string without using
built-in function. NOV 14
21. Write a C program to search an element in a given array. NOV 14, MAY 15
22. Write a C program to arrange the given 10 numbers in ascending order. MAY 15, NOV 17
23. What are the different types of string function? Apr/May 2018
24. Write the C program to find the number of Vowels, Consonants, Digits and white space in a string.
Apr/May 2018
25.What is string? Explain about declaration and initialization of string in ‘C’. How strings are
displayed with different formats? Explain with examples. NOV/DEC 21
26.Write a C program to check whether the given matrix is symmetric or not. NOV/DEC 21
27.Explain different string handling functions available in C with example. . NOV/DEC 21
28.Write a C program to access the values of an array of elements using pointer. NOV/DEC
21.
29.Explain the concept of arrays in detail with an example program. NOV/DEC 21
30.Write a program in C to (i) Add and (ii) Multiply two given matrices. NOV/DEC 21
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C

UNIT III FUNCTIONS AND POINTER 9


Modular programming - Function prototype, function definition, function call, Built-in functions
(string functions, math functions) – Recursion, Binary Search using recursive functions –
Pointers – Pointer operators – Pointer arithmetic – Arrays and pointers – Array of pointers –
Parameter passing: Pass by value, Pass by reference.
PART-A
1. Is it possible to place a return statement anywhere in ‘C’ program?
2. How can you return more than one value from a function?
3. What is the difference between an array and pointer?
4. What is the purpose of the function main ()? MAY 09
5. Specify the advantages of function. MAY 16
6. What is dangling pointer?
7. Is it better to use a macro or a function?
8. What is ‘C’ functions? Why they are used?
9. What is a use of ‘return’ Keyword?
10. Give the syntax for using user-defined functions in a program
11. Classify the functions based on arguments and return values
12. What is function definition? NOV 15
13. Distinguish between Call by value and Call by reference. NOV 17
14. What is pointer? How will you declare it? MAY 12,10, JAN 13
15. Define pointer to a pointer?
16. What are the operations that can be performed on pointers?
17. How is pointer arithmetic done? MAY 16
18. What is an address operator and indirection operator? What are * and & operators means? NOV14,15
19. State void pointer and a null pointer.
20. What are formal parameters and actual arguments
21. What is a function call? Give an example of a function call
22. Explain default arguments and command line arguments?
23. What is a recursive function?
24. State the uses of Pointers? JAN 13, 14
25. What is the need for functions? JAN 14
26. Define a C function to exchange the content of two variables. JAN 09
27. Mention the difference between Library function and User defined functions. MAY 12
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C
28. What are the operators used in pointers JAN 12
29. Define Function prototyping? Why is it necessary? MAY 11
30. Explain various types of functions in detail with an example program for each type.
31. Define Recursion in C
32. What are functions in C? NOV 14
33. What are the advantages of using pointers in a program? NOV 17
34. list the advantage of recursion.Apr/May 2018
35. when null pointer is used. Apr/May 2018
36. specify the use of typedef. Apr/May 2018
37. Why addition of two pointers is impossible. Nov/Dec 2021
38. What is the difference between NULL. ‘\0’ and 0? Nov/Dec 202.
39. Compare actual parameters and formal parameters. Nov/Dec 2021

PART-B
1. Discuss about pointers and their operations that can be performed on it MAY 09, JAN 09
2. What is an array of pointers and what is pointer to an array? Explain in detail with example.
3. Explain in detail about Pass by Value and Pass by reference. DEC 01, 10,11, 12,14,15, MAY 10, 11,16
4. What do you mean by Call by reference? Explain call by Value to exchange values of two variables.
JAN11, MAY 10
5. Explain in detail about function pointers. MAY 09
6. What are the applications of recursive function? JAN 14
7. Explain function Prototyping each with an example.
8. Explain function with arguments and with return type with an example. JAN 09
9. Differentiate Pass by value and pass by reference. JAN 10
10. Write a function using pointers to add two matrices and to return the resultant matrix to the calling
function. MAY 12
11. Write a C program to find the Factorial using recursion. JAN 12
12. What are functions? Explain the types of functions in detail with an example program for each type.
13. What is pointer? When and why they are used? Explain in detail with sample programs. JAN 09, MAY
09
14. Brief call by value and call by reference in detail. MAY 10, NOV 14
15. Discuss about function prototypes in detail.
16. Explain about the different parameter passing methods with examples. JAN 09, NOV 17
17. Write a C Program to print Fibonacci Series using recursion
18. Write a C Program to calculate Area of Circle using Pointer.
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C
19. What is recursion? Explain a recursive function with suitable example. Write a iterative and recursive
function to find the power of a number. NOV 14
20. Write a C program to find the factorial of a given number using function. MAY 15
21. Write a C program to exchange the values of two variables using pass by reference. MAY 15, NOV 17
22. Write a C program to find the sum of the digits using recursive function. MAY 15
23. Write a program using pointer to read in an array of integers and print elements in reverse order. MAY
15, NOV 17
24. What is recursion? Explain a recursive function with suitable example. Write a recursive function to
find the factorial of a number. NOV 15
25. Write a C program to count the number of words in a string using pointers. MAY 16
26. Explain the purpose of function Prototyping. Apr/May 2018
27. What is difference between call by value and call by reference in detail.write the coding swapping of
two numbers. Apr/May 2018
28. Explain the following with suitable examples.
(i) Function declaration. (8)
(ii) Call by reference, call by value. (8) NOV/DEC 2021

29. Explain function with and without arguments with example for each. (10) NOV/DEC 2021
What is recursion? Give an example. (6) NOV/DEC 2021
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C

UNIT IV STRUCTURES AND UNION 9


Structure - Nested structures – Pointer and Structures – Array of structures – Self referential
structures – Dynamic memory allocation - Singly linked list – typedef – Union - Storage classes
and Visibility.
PART-A
1. Compare structures and unions. MAY 09, JAN 10, 12
2. Define Structure in C. JAN 13, MAY 15
3. What do you mean by structures? MAY 16
4. What you meant by structure definition?
5. What is meant by Union in C.? JAN 11,13
6. How to define a union in C ? JAN 10
7. State the importance of union. MAY 16
8. Write a note on register storage in storage class? NOV 15
9. What is static storage class? JAN 10
10. Define Auto storage class in C.
11. Define pre-processor in C. JAN 13
12. Define Macro in C. June 2008
13. What is a nested structure? JAN 13
14. How typedef is used in structure?
15. Define Union in C. JAN 11
16. Give any three comparison of structure and union. NOV 10, JAN14
17. List some of the preprocessor directives available in C language. NOV 12, JAN14
18. Give the syntax for dot operator.
19. Define static storage class. NOV 14
20. What is the use of #define preprocessor? NOV 14,15, MAY 15
21. How can you access the members of the Union?

PART-B
1. Define Structures. Explain structures in detail. JAN 12,13,14
2. Explain Array of structure in C.
3. How can pass a structure to function in C.
4. How can you insert structure with in another structure?
5. Explain the concept of pointer to structure.
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C
6. Define Union. Explain Union in detail. JAN 09
7. What are storage classes? Explain each with example. MAY 15,16
8. Describe in detail about the Preprocessors in C. JAN 11
9. Explain about pre processors with suitable example. MAY 09,16
10. What is enumeration explain with examples.
11. Explain functions and structures. JAN 12,13
12. Explain about structures and its operations. JAN 10,11
13. Explain about pointers to structures, array of structures and nested structures.
14. Write a C program using structures to prepare the students database. MAY 12, NOV 17
15. Write a C program using unions to prepare the employee pay roll of a company.
16. Define Union. Explain Union in detail. JAN 09
17. Define Structures. Explain structures in detail. JAN 09,MAY 09
18. How can pass a structure to function in C.
19. Explain in detail about unions with suitable example.JAN 09, MAY 10,11
20. Write a C Program to accept a string using pointers and functions. JAN 10
21. What are Structures? Create a structure with data members of various types and declare two structure
variables. Write a program to read data into these and print the same. NOV 14,NOV 15
22. Justify the need for structured data type NOV 14
23. Write a C program using Union and Structure to prepare the Library database.
24. Write a C program using Union and Structure to prepare the Patients list.
25. Write a C program using nested structure to prepare the students database.
26. Write a C Program to illustrate an array of structure JAN 10
27. What is union ? Discuss with an example.MAY 15
28. Write short notes on: NOV 15
(i) Union
(ii) Static Storage Class, Register storage class
(iii) #include statement
(iv) #ifndef…#endif
29. Write algorithm and a C program using unions, to prepare the employee pay roll of a company. NOV 17
GLOBAL INSTITUTE OF ENGINEERING AND TECHNOLOGY
(Approved by AICTE, Affiliated to Anna University, Chennai)
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
PROGRAMMING IN C

UNIT V FILE PROCESSING 9

Files – Types of file processing: Sequential access, Random access – Sequential access file -
Random access file - Command line arguments.

PART-A
1. Define File.
2. Specify the various types of file.
3. Describe the various operations performed on a file.
4. Specify the structure of creating a file.
5. How to read the file content.
6. What is the need of file pointer?
7. How to display the file content in the screen?
8. Differentiate sequential and random access file.
9. Why do we need files?
10. Differentiate binary and text file.

PART-B

1. Explain the basic file operations with a neat sketch and suitable program.
2. Explain sequential access file with example program.
3. Explain random access file with example program.
4. Write a program to illustrate command line arguments.
5. Write a program to store and read record of an employee in employee file, where they must be
stored using binary file.
6. Write a program to store and read record of an student in student file, where they must be
stored using binary file.
7. Write a program to store and read record of an customer in bank file, where they must be stored
using binary file.
8. Write a program to read and write a text file using fscanf() and fprintf().
9. Write a program to read and write a binary file using fscanf() and fprintf().

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy