Problem Solving Through Programming In C Quiz 2
A function is
a) Block of statements to perform some specific task
b) It is a fundamental modular unit to perform some task
c) It has a name and can be used multiple times.
a) Block of statements to perform some specific task
b) It is a fundamental modular unit to perform some task
c) It has a name and can be used multiple times.
All of the options are correct for function.
If an integer requires two bytes of storage, what is the maximum value of an unsigned integer in C?
216-1
Which of the following statements is correct?
I. Keywords are those words whose meaning is already defined by Compiler.
II. Keywords cannot be used as variable names.
III. There are 32 keywords in C
IV. C keywords are also called reserved words.
I. Keywords are those words whose meaning is already defined by Compiler.
II. Keywords cannot be used as variable names.
III. There are 32 keywords in C
IV. C keywords are also called reserved words.
All of the given options are correct.
Which of the following header files is not a standard C library?
a) stdlib.h
b) math.h
c) iostream.h
d) stdio.h
a) stdlib.h
b) math.h
c) iostream.h
d) stdio.h
c) iostream.h
What is the primary use of the ‘printf’ function in C?
To display output on the screen.
What is the purpose of the ‘return’ statement in C?
To exit a function and return a value.
What is typecasting in C?
Converting a variable from one data type to another.
If an integer needs two bytes of storage, then the minimum value of a signed integer in C would be
-215
If an integer needs two bytes of storage, then the minimum value of an unsigned integer in C would be
0
Which of the following is a correct C Keyword?
a) breaker
b) go to
c) shorter
d) default
a) breaker
b) go to
c) shorter
d) default
d) default
Integers can be of the following type in C?
a) short
b) int
c) long
a) short
b) int
c) long
All of them are correct integers.
The operator % in C Language is called?
Modulus
What is a C Storage Class?
a) C Storage decides where to or which memory store the variable.
b) C Storage Class decides what is the default value of a variable.
c) C Storage Class decides what is the Scope and Life of a variable.
a) C Storage decides where to or which memory store the variable.
b) C Storage Class decides what is the default value of a variable.
c) C Storage Class decides what is the Scope and Life of a variable.
All of the options are correct for C Storage Class.
Syntax error occurs when
a) The rules of grammar of the programming language is violated
b) The statements in the program have no meaning.
a) The rules of grammar of the programming language is violated
b) The statements in the program have no meaning.
a) The rules of grammar of the programming language is violated.
What is the correct way to declare a constant in C?
a) int const a;
b) constant int a;
c) #define a
a) int const a;
b) constant int a;
c) #define a
Both (a) and (c)
What will be the output of the following code snippet? printf(“%d”, 5 == 5);
1
What will happen if you try to store a value beyond the range of the declared data type of a variable in C?
Data loss or wrap around.
Which of the following is not a primitive data type in C?
a) int
b) float
c) char
d) string
a) int
b) float
c) char
d) string
d) string
What is the size of an ‘int’ data type in C?
a) 2 bytes
b) Depends on the compiler
c) 4 bytes
a) 2 bytes
b) Depends on the compiler
c) 4 bytes
b) Depends on the compiler
Which keyword is used to create a constant variable in C?
const
What is the default return type of a function in C if it is not explicitly specified?
int
Also Available:
Problem Solving Through Programming In C Quiz 1