ExamLookup
Menu mobile
Home
Current Affairs
General Knowledge
Computer
Python
HTML
MCQ C LANGUAGE - STORAGE CLASS MCQ Questions
English
Hindi
Question No. -
01
Report Bug
static storage class is used to make a variable global.
static storage class is used to make a variable global.
A.
TRUE
सही
B.
FALSE
गलत
Question No. -
02
Report Bug
Which of the following is not a proper storage class in C?
Which of the following is not a proper storage class in C?
A.
auto
auto
B.
dec
dec
C.
static
static
D.
extern
extern
Question No. -
03
Report Bug
Which of the following statement is false?
Which of the following statement is false?
A.
Constant variables need not be defined as they are declared and can be defined
later
Constant variables need not be defined as they are declared and can be defined
later
B.
Global constant variables are initialized to zero
Global constant variables are initialized to zero
C.
const keyword is used to define constant values
const keyword is used to define constant values
D.
You cannot reassign a value to a constant variable
You cannot reassign a value to a constant variable
Explanation
Since the constant variable has to be declared and defined at the same time, not doing it results in an error.
Question No. -
04
Report Bug
The default storage class of a ‘C’ variable is
The default storage class of a ‘C’ variable is
A.
auto
auto
B.
static
static
C.
extern
extern
D.
register
register
Explanation
The auto storage class is the default storage class for all local variables. The example above defines two variables with in the same storage class. 'auto' can only be used within functions, i.e., local variables.
Question No. -
05
Report Bug
The default initial value of a static int variable is zero.
The default initial value of a static int variable is zero.
A.
TRUE
सही
B.
FALSE
गलत
Question No. -
06
Report Bug
Which of the following is not a proper storage class in ‘C’?
Which of the following is not a proper storage class in ‘C’?
A.
auto
auto
B.
dec
dec
C.
static
static
D.
extern
extern
Question No. -
07
Report Bug
What is the output of the following code?
main()
{ static int num=8;
printf(“%d ”,num=num-2);
if(num!=0) main(); }
What is the output of the following code?
main()
{ static int num=8;
printf(“%d ”,num=num-2);
if(num!=0) main(); }
A.
8 6 4 2
8 6 4 2
B.
Infinite output
Infinite output
C.
6 4 2 0
6 4 2 0
D.
Invalid because main function can’t call itself.
Invalid because main function can’t call itself.
Question No. -
08
Report Bug
‘auto’ keyword is used to declare a local variable.
‘auto’ keyword is used to declare a local variable.
A.
TRUE
सही
B.
FALSE
गलत
Question No. -
09
Report Bug
What will be the output of the following code segment?
void fn() {
static int i = 10;
printf("%d ", ++i);
}
main() {
fn();
fn();
}
What will be the output of the following code segment?
void fn() {
static int i = 10;
printf("%d ", ++i);
}
main() {
fn();
fn();
}
A.
10 10
10 10
B.
11 11
11 11
C.
11 12
11 12
D.
12 12
12 12
Question No. -
10
Report Bug
If no storage class is mentioned for a variable defined in a function then it is by default auto.
If no storage class is mentioned for a variable defined in a function then it is by default auto.
A.
TRUE
सही
B.
FALSE
गलत
1
2
3
4
CCC Online Test 2021
CCC Practice Test Hindi
Python Programming Tutorials
Best Computer Training Institute in Prayagraj (Allahabad)
O Level NIELIT Study material and Quiz
Bank SSC Railway TET UPTET Question Bank
career counselling in allahabad
Sarkari Exam Quiz
Website development Company in Allahabad