Multiple Choice Questions: Unit 1 Short Answer Questions
Multiple Choice Questions: Unit 1 Short Answer Questions
Multiple Choice Questions: Unit 1 Short Answer Questions
Answer C
Answer : b
3. Preprocessor Directives are used for –
A] Macro Expansion
B] File Inclusion
C] Conditional Compilation
D] All of these
Answer : D
A. Function
B. Pointer
C. Enumeration
D. Array
Answer : C
B. | (pipeline)
C. - (hyphen)
D. _ (underscore)
Answer: D
Answer: D
Answer: D
10. What does this statement printf(“%10s”, state); means?
a) 10 spaces before the string state is printed
b) Print empty spaces if the string state is less than 10 characters
c) Print the last 10 characters of the string
d) None of the mentioned
Answer: B
1. ___________ is the range of signed int data type in that compiler in which size of int is
two byte?
Answer. 4 Bytes
3 . #include <stdio.h> is called _______________
Answer: Preprocessor directive
4 . A ______________ is a program , That processes its input data to produce output that is
used as input to another program
Answer: Preprocessor
5. If #include is used with file name in angular brackets _______ is searched for in the
standard compiler include paths.
Answer: file
7. If integer needs two bytes of storage, then maximum value of an unsigned integer is
_______
Answer : 216 – 1
8_______ is the only function all C programs must contain?
Answer: main()
9. _________________ refers to the perminance of a variable and its scope
Answer: scope
UNIT 2
1. write
a short note on Arithmetic operators with examples
2. write a short note on relational operators with examples
3. write a short note on Bitwise operators with examples
4. write a short note on Logical operators with examples
5. write a program to check a given number is even or odd.
6. What is type casting
7. distinguish between do-while and while
8. write a short note on if structure with an example
9. write a short note on
a. break b. continue c.goto
10. discuss briefly on ?: operator with an example
a) conditional
b) relational
c) casting operator
d) none of the mentioned
Answer : a
A,+
B. –
C. *
D. %
Answer : D
A] ++
B] %
C] +
D] ||
Answer: C
A] (type)
B] cast()
C] //
D] “ “
Answer: A
B. *
C /
D. %
Answer: D
Answer:
7. Data type of the controlling statement of a SWITCH statement cannot of the type:
A. int
B. char
C. short
D. float
Answer: D
8. How long the following loop runs?
for(x=0;x=3;x++)
A. four times
B. three times
c. two times
D. never
Answer: D.
B. switch
C. if
D. while
Answer: B
Answer : Iterative
Answer: Casting
Answer: Logical
9. A _____________ statement is used to choose from multiple possibilities which may arise
due to different values of a single variable
Answer: switch
10. __________ is used inside a loop to terminate the current iteration and start with the next
generation [ ]
Answer: break
UNIT 3
SHORT ANSWER QUESTIONS
A. Sequential
B. Random
C. Sequential and Random
D. None of the above
Answer : A
C.int n{6} = { 2, 4, 12 };
A. 5
B. 7
C. 9
D. 11
A. 2
B. 8
C. 50
D. Theoratically no limit. The only practical limits are memory size and compilers.
Answer: D
B. It is a declaratrion
C. It is a formal parameter
D. All of these
Answer: D
6. Array passed as an argument to a function is interpreted as
7. Which of the following correctly accesses the seventh element stored in arr, an array
with 100 elements?
A. arr[6]
B. arr[7]
C. arr{6}
D. arr{7}
A. Array
B. Character
C. Record
D. String
A. ‘Hello World’
B. “Hello World”
C. Hello World
D. All of the above
Answer: B
B. 1
C. 2
D. 0
Answer: D
2.. _________________ is the index of the last element of an array with 9 elements ?
Answer : 8
Answer: 40
5. If the size of the array is less than the number of initializers then, _________________
Answer: \0
9. ___________ is the return value of the following statement if it is placed in C
program? strcmp("ABC", "ABC");
Answer: 1
UNIT 4
Answer: B
3. What is the built in library function copies the portion of one string into another
string.
A. Strcpy
B. Strncpy
C. Strncat
D. Strtok
Answer: B
5. Any c program
A.call by value
B.call by reference
D.None of these.
Answer: A
Answer: B
A.Parallel order
D. Iterative order
Answer: C
B. 1
C. 0
Answer:D
A. sqr(x)
B. pow(2, x)
C.. pow(x, 2)
D. power(2, x)
Answer:C
3.. A function that calls itself for its processing is known as ______________
4. We declare a function with ______ if it does not have any return type
Answer : void
Answer. Local
6. When a function is recursively called all the automatic variables are stored in
a ..........
Answer: Stack
Answer: double
8.The _____________________ string function adds a string at the end of another string
Answer: Strcat
UNIT 5
SHORT ANSWER QUESTIONS
A.VOID Pointer
B. DANGLING Pointer
C. NULL Pointer
D. WILD Pointer
Answer C
A. Constructor
B. dangling pointer
C. Wild Pointer
D. Destructor
C
4. Which of the following are themselves a collection of different data types?
a) string
b) structures
c) char
d) All of the mentioned
Answer: b
a) struct
b) enum
c) typedef
d) All of the mentioned
Answer: d
a) –
b) <-
c) .
d) Both (b) and (c)
Answer: C
7. typedef declaration
a) Does not create a new type
b) It merely adds a new name for some existing type.
c) Both a & b
d) None of the mentioned
Answer: c
Answer: C
4. In order to fetch the address of the variable we write preceding _________ sign
before variable name.
Answer: Ampersand
Answer:
9. ___________ is the correct syntax to access the member of the ith structure in the array of
structures is?
Assuming: struct temp
{
int b;
}s[50];
Answer: s[i].b;
10. ___________ is the correct syntax to declare a function foo() which receives an array of
structure in function?