C Storage Classes and Type Qualifiers Questions

Hello PrepSter,

If you find any errors in the quiz below kindly comment in the comment section and we will make it our priority to fix it.

Also if you have a better of the solution to the questions, please do comment them below and if we find it better than ours, we will post it in our website.

Question 1

Time: 00:00:00
Select the correct option.

unsigned long double is a valid data type.

unsigned long double is a valid data type.

long long double is a valid data type

long long double is a valid data type

unsigned long long int is a valid data type

unsigned long long int is a valid data type

All are valid

All are valid

All are invalid

All are invalid

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 2

Time: 00:00:00
Which is the following is a valid declaration ?

int fun(register int a)

int fun(register int a)

int fun(static int a)

int fun(static int a)

int fun(auto int a)

int fun(auto int a)

int fun(extern int a)

int fun(extern int a)

All of the above.

All of the above.

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
Which of the following are visible global ?

Register

Register

Auto

Auto

Extern

Extern

Static

Static

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
Select the statement that is true in relation with volatile and constant.

They are opposites of each other.

They are opposites of each other.

They can't be used for typedef .

They can't be used for typedef .

They can't be used for structure and union.

They can't be used for structure and union.

They are independent. A variable can be both volatile and constant.

They are independent. A variable can be both volatile and constant.

They can't be used for enum.

They can't be used for enum.

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
What is the output of the following program ?
#include <stdio.h>
int main()
{
static int var=5;
printf("%d ",var);
if(--var){
main();
printf("%d ",var);
}
}

5 4 3 2 1 1 2 3 4

5 4 3 2 1 1 2 3 4

5 4 3 2 1 2 3 4 5

5 4 3 2 1 2 3 4 5

0 0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0

5 4 3 2 1 0 0 0 0

5 4 3 2 1 0 0 0 0

Compiler error.

Compiler error.

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
There a difference between a pointer to a constant and a constant pointer.

True

True

False

False

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 7

Time: 00:00:00
What is the output of the given code ?
#include<stdio.h>
int main()
{
typedef static int *p;
int i;
p a = &i;
printf("%d", *a);
return 0;
}

1

1

Garbage value

Garbage value

Compiler error

Compiler error

0

0

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
Select the correct output for the following code ?
#include<stdio.h>
int main()
{
typedef int i;
i var = 0;
printf("%d", var);
return 0;
}

0

0

1

1

Garbage value

Garbage value

compiler error.

compiler error.

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
What is the expected output of the program below ?
#include<stdio.h>
int main()
{
typedef int *p;
int i = 10;
p *pt = &i;
printf("%d", **pt);
return 0;
}

(null)

(null)

10

10

garbage value.

garbage value.

compilation error.

compilation error.

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

Question 10

Time: 00:00:00
Select the option with the correct output for the following code.
#include <stdio.h>
int loo()
{
static int num = 22;
return num--;
}

int main()
{
for(loo(); loo(); loo())
printf("%d ", loo());
return 0;
}

20 17 14 11 8 5 2

20 17 14 11 8 5 2

21 18 15 12 9 6 3

21 18 15 12 9 6 3

20 17 14 11 8 5 2 0

20 17 14 11 8 5 2 0

21 18 15 12 9 6 3 0

21 18 15 12 9 6 3 0

Once you attempt the question then PrepInsta explanation will be displayed.

Please login to submit your explanation

Start

["0","40","60","80","100"]
["Need more practice!","Keep trying!","Not bad!","Good work!","Perfect!"]