1.
“Keywords cannot be used as Identifiers” – Justify the
correctness of the statement.
2. Distinguish between ‘While’ and ‘Do-While’ looping
constructs with one example.
3. Give an example for initialization of a 2D array with a set
of values.
4. Write any two string handling functions in C with their
syntax and purpose.
5. Find the output of the following code.
a. int main ()
b. {
c. int a=10,b=20;
d. change(&a,b);
e. printf(“\n Inside Main: %d%d\n”,a,b);
f. return 0;
g. }
h. void change (int*p,int q)
i. {
j. *p=*p*3;
k. q=q*4;
l. printf(“\n Inside function :%d%d”,*p,q);
m. }
6. If p is a pointer to a float array a[10]with base address
1000,then what is the value of p after executing the
statement p++;? Justify your answer.
7. Differentiate ‘Structure’ and ‘Union’.
8. Illustrate with an example for each, the following operators
with regard to pointers and structures. &,*,.,->.
9. What will be the values for argc and argv[] when the input
“run with my values “is passed as command line
arguments?
10.Name any two functions used in Random access files and
specify their use in C programming.
11.Draw the Structure of C Program.
12.What is the purpose of format specifier in I/O statements?
Give an example.
13.Write down the syntax and give an example for array
initialization.
14.How to identify the length of a string?
15.What is the function prototype? Give an example.
16.What are the differences between user defined functions
and build-in-functions?
17.What do you mean by self-referential structure?
18.What is unique about the storage class ‘register’?
19.Describe the prototype of the function fopen().
20.List the various mode of accessing a file through C.
PART B
1.(i) Evaluate the following expressions using operator
precedence rule. Explain the order of execution of operators.
(8*3-4) +(5%5?3: -9) +5-20/10
A*b+(c/d)-2^2-(e+4) where a=2, b=3, c=8, d=2, e=5.
(ii) Elaborate the various Data types in C with suitable
examples.
2.(i)Write a C program to get age and vaccination details as
input. Print “Senior Citizen and Eligible for Booster” if age>60
and vaccination input as ‘2’. Otherwise print “Below 60, and
Eligible for Vaccination”. Use Conditional Operator.
(ii) Is it possible to convert ‘if-else’ ladder to ‘switch…. case’
statement? If yes, illustrate with an example. If no, justify the
reason.
3.(i)Write the string handling function used to do the following.
If first name, last name and middle name are given as
input, display it as full name.
Display the number of characters in full name.
Convert the first name into capital letters and last name
into small letters.
(ii) In a restaurant, the tables are arranged in a room row-wise
order. A waiter is assigned to serve food for each row. Write a C
program to find the highest bill served by each waiter.
4. (i) Explain binary search technique with an example. How to
search for the key’14’in the array of numbers
12,56,90,14,19,63,88,25,37,49,110.
(ii) In a Marathon, there are 5 tracks. In each track ‘n’number of
participants are placed. Find the youngest and oldest participant
in each track.
5. i)Write a C program to create two 2D arrays using array of
pointers. First 2D array consists of a list of employee names and
the second 2D array consists of their designation. Your code
should display the designation when name is entered.
(ii) Give an example for a function that receives parameters and
returns no value,
6.(i) Create an array of lucky ticket numbers announced for prize
bonanza. Get a ticket number and check it for prize and display
the result. Use pointer to array concept.
(ii) Differentiate between ‘Pass by value’ and ‘Pass by reference’
with an example.
7. (i) List the operations on Linked list. Explain insertion at end
and deletion at beginning of a singly linked list.
(ii) Distinguish between calloc () and malloc () functions.
8.(i) Consider a structure ‘furniture’ that includes the information
about furniture in a shop. Write a function call statement that has
the argument as a pointer to the structure and number of
furniture. Also, provide the corresponding function definition
statement that receives the arguments.
(ii) Use ‘typedef’ to define ‘furniture’ as array of structures.
9. (i) Mention the purpose of fseek() function in random files.
(ii) When to use fread() and fwrite() functions in file processing?
List down the modes in which a C file can be opened. Specify the
purpose of each mode.
10. Write a C program to create a binary file in C named
“application.txt” that has the data such as citizen name, aadhar
number, pan number, employment, gender and age. Filter the
application by analysing the gender and employment and move
all the male applicants who are self-employed into another file
called “reject.txt”.Assume minimum 10 candidates.
11.Explain the various data types being supported by C language
12. Explain about the various looping statements available in ‘C’
with appropriate sample programs.
13.(i) What is an array? Explain about one dimensional array with
a sample program.
(ii) Write about the significance of header file ’string.h’and write
short notes on any three string functions.
14. i) Write and explain the procedure for selection sort.
(ii) Write a C program to demonstrate matrix addition.
15. Write short notes on the following:
(i)Function prototype and function call.
(ii)Function definition and return value.
16. Enumerate the difference between call by value and call by
reference with suitable examples
17.(i) Explain the need for nested structures with appropriate
example program.
(ii) Can a linked list grow dynamically? Justify your answer with
example C program.
18.(i) With suitable diagram, explain the concept of singly linked
list.
(ii) Enumerate the difference between structure and union with
example.
19. How random accessing of files are done in C language?
Explain in detail.
20. What is the purpose of the variables argc and argv of
command line arguments in C language? Explain with a sample
program.
PART C
1.Explain in detail various operations that can be done on file giving suitable
examples
2. Explain in random access in file along with the functions used for the same in
C. Give suitable examples.
3. i) Mention the purpose of fseek()function in random files.
(ii) When to use fread() and fwrite() fucntions in file processing?
(iii) List down the modes in which a C file can be opened. Specify the purpose of
each mode.
(iv) What is the use of feof() function?
4. Write a C program to create a binary file in C named “application.txt” that has
the data such as citizen name, aadhar number, Pan number, employment gender
and age. Filter the application by analysing the gender and employment and
move all the male applicants who are self-employed into another file called
“reject.txt”. Assume minimum 10 candidates