2. Part-A contains 10 Multiple Choice Questions of 1 mark each.
3. Part-B contains 5 questions carrying 12 marks each.
PART-A
Answer all questions. All questions carry equal marks.
--- Content provided by FirstRanker.com ---
-
Choose the valid variable name from the following:
- 123var
- var123
- var name
- $var
--- Content provided by FirstRanker.com ---
-
Which of the following is a keyword in C?
- For
- While
- Do
- All the above
--- Content provided by FirstRanker.com ---
-
What is the output of the following code snippet?
#include <stdio.h> int main() { int x = 5; printf("%d", x++); return 0; }
- 5
- 6
- 4
- Error
--- Content provided by FirstRanker.com ---
-
Which operator is used to access the member of a structure using a pointer?
- . (dot)
- -> (arrow)
- * (asterisk)
- & (ampersand)
--- Content provided by FirstRanker.com ---
-
What is the purpose of the
malloc()
function?--- Content provided by FirstRanker.com ---
- Allocate memory
- Free memory
- Reallocate memory
- None of the above
-
What is the use of header files in C?
- To include standard library functions
- To define user-defined functions
- To declare variables
- All of the above
--- Content provided by FirstRanker.com ---
-
Which of the following is the correct way to open a file in read mode?
fopen("file.txt", "r")
fopen("file.txt", "w")
fopen("file.txt", "a")
fopen("file.txt", "rb")
--- Content provided by FirstRanker.com ---
-
What does the acronym 'CPU' stand for?
- Central Processing Unit
- Computer Processing Unit
- Control Processing Unit
- Central Program Unit
--- Content provided by FirstRanker.com ---
-
Which data structure follows the LIFO (Last In, First Out) principle?
- Queue
- Stack
- Array
- Linked List
--- Content provided by FirstRanker.com ---
-
What is the purpose of the
#include
directive?--- Content provided by FirstRanker.com ---
- To include a file
- To define a macro
- To declare a variable
- To define a function
--- Content provided by FirstRanker.com ---
--- Content provided by FirstRanker.com ---
PART-B
Answer all questions. All questions carry equal marks.
-
a) Explain different types of operators used in C language with examples.
(OR)
--- Content provided by FirstRanker.com ---
b) Explain the structure of a C program with an example.
-
a) Write a C program to check whether the given number is prime or not.
(OR)
b) Explain different types of looping statements in C with examples.
--- Content provided by FirstRanker.com ---
-
a) Write a C program to find the largest element in an array.
(OR)
b) Explain different types of string handling functions with examples.
-
a) Explain the concept of recursion with an example. Write a C program to find factorial of a number using recursion.
(OR)
b) Explain different types of parameter passing techniques with examples.
-
a) Explain the concept of dynamic memory allocation with examples.
--- Content provided by FirstRanker.com ---
(OR)
b) Write a C program to copy the contents of one file to another.
--- Content provided by FirstRanker.com ---
Get more study materials at FirstRanker.com
--- Content provided by FirstRanker.com ---