K. J.
Somaiya Institute of Technology, Sion, Mumbai-22
(Autonomous College Affiliated to University of Mumbai)
Subject : C Programming
Question bank for ESE
1. Mention the different types of Tokens in “C” , and explain one of them.
2. What is flowchart? Explain use of different Symbols of flowchart.
3. Explain the terms variables and constants .How many types of variables are supported by C.
4. Write a C program to determine whether a given number is negative, positive or zero, using if-
else statements.
5. Explain nested if else statement with example.
6. Write algorithm to find sum of five integer numbers.
7. Write a C program to check entered number is prime or not.
8. Define function with example.
9. Describe string library function 1)strcat() 2)strlwr() 3)strlen() 4)strcpy() 5)strcmp 6)strrev()
10. Explain break and continue statement with example.
11. What is the difference between declaration and definition of function.
12. Write a C program that calculates the factorial of an integer using recursion
13. Why do we prefer iteration over recursion in any C program?
14. Give an example of nested structure.
15. What is structure? Write one example of structure.
16. What are the advantages and Disadvantages of Array?
17. Differentiate between Structure and Union.
18. What is file? Explain different file operations.
19. Explain different operators in c.
20. Write syntax of for loop and nested for loop.
21. Identify the types of pointers from the below two programs:
1. #include 2. #include
<stdio.h> <stdio.h>
int main(){ int main(){
int *ptr = NULL; int *p;
printf("%d", *ptr); *p=10;
return 0;} printf("%d", *p);
return 0;}
22. What are the C file operations, provide six different possible file operation function?
23. Derive the output of the below code snippet . Give proper explanation to your answer.
#include <stdio.h>
int main(){
int c = 5, no = 10;
do {
no /= c;
} while(c--);
printf (\"%d\\n\", no);
return 0;}
24. What is pointer? Write syntax to declare pointer.
25. Explain difference between while and do while loop.
26. What is an algorithm? Write an algorithm to check whether given number is odd or even?
27. What is the need of algorithm and mention properties of algorithms.
28. Write a program to calculate and display the sum of first n natural number using while loop.
29. Write a program in C to display n numbers of natural numbers and their sum.
30. Explain all the storage classes in C with any one example
31. Write a program to check if the user entered number is divisible by 10 or not..
32. Explain different storage classes in c.
33. Discover 4 differentiation between String and Character.
34. Define a structure called Player with data members: Player name, team name, batting average.
Create array of objects, store information about players, sort and display information of players in
descending order of batting average.
35. Write a program to find fibonnaci series upto n number using function.
36. Write a C program that copies the contents of one text file into another.
37. Write a program to sort number of an array in ascending order using user defined function.
38. Write a program to sort number of an array in ascending order using user defined function.
39. Write a program to display information of 10 books using array of structure.
40. Write a program to display information of 10 students using array of structure.
41. Provide an example demonstrating the declaration and initialization of a structure named “Point”
, Also display the coordinates.
Hint : P(x,y) In mathematics a point is having two coordinates i.e. x and y.
42. Differentiate between call by value and call by reference.
43. Write a program to count the number of digits, alphabets, and special characters in an input string.
44. Differentiate between Static memory allocation and Dynamic memory allocation.
45. Explain the result of following code snippet with justification:
int num1=2,num2=3;
int *p = &num1,*q = &num2;
*p++ = *q++
a) What are the values of num1,num2 and *p ,*q after this code executes?
b) Explain the result with justification, especially focusing on the use of the post-increment
operator (p++, q++).
46. Develop a flowchart to display whether the given year is a leap year or not?
47. Write a program that calculates the roots of quadratic equation. Draw the flowchart for it.
48. Write a program to convert a decimal number to binary format. Draw the flowchart for it.
49. What is array? Explain the various ways to initialize array using example.
50. Write a program to find length of given string and copy one string into another string using user
defined function.
51. Write a C program that copies the contents of one text file into another.
52. Write a program to concatenate the given strings and check whether given string is palindrome or
not.
53. Write a program to display result of students by using nested if else.
54. Write a program to display information of player in ascending order with respect to their batting
average. Define a structure called cricket that will describe the player’s name,country name,best
score,batting average.
55. Explain the concept of nested structure with following example:
Create structure
product {cost, id, type} and
structure delivery { del_date, del_number, del_type)
56. Implement a C program to read weekday numbers and print weekday names using switch cases.
57. What is a recursive function? Write a program to find GCD of given number using recursive
function
58. Write a program to read name, id, salary, date of joining using nested structure to get the address
of an employee.
59. Write a program in C to find the sum of digits using do-while loop
60. Explain all the storage classes in C with example
61. Write a program to display information of employees by using nested if else.
62. What is a recursive function? Write a program to find factorial of given number using recursive
function
63. Write a program to read and store n integers in an array, where the value of n is decided by the
user. Find minimum and maximum numbers from the array.
64. Why do we need File handling in “C” , also explain the two distinct types of data files in “C”
language and explain what is "r+” and “rb+” opening mode in “C”.
65. What is an algorithm? Write an algorithm to check whether a given number is odd or even?
66. Explain dynamic memory allocation functions.
67. Write a program to find largest of three numbers using ternary operator
68. Find the output of the following program
#include<stdio.h>
void main()
{
int x = 10,y,z;
z = y = x;
y-=--x;
z-=x--;
x-=--x-x--;
printf(“x = %d y = %d z =%d”,x,y,z);
}