C Storage Classes and Type Qualifiers Questions 2

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
What is the correct output of he following program ?
#include <stdio.h>
int main()
{
int var = 10;
int * const p = &var;
++(*p);
printf("%d", var);
return 0;
}

10

10

(null)

(null)

Some agrgabe value for the next address location after the variable var.

Some agrgabe value for the next address location after the variable var.

11

11

Compile error.

Compile error.

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

Please login to submit your explanation

Start

Question 2

Time: 00:00:00
What is the expected output of the following program ?
#include <stdio.h>
int main()
{
int var = 10;
static int i = var;
if(var == i)
printf("They're equal ");
else if(var > i)
printf("Var is greater");
else
printf("i is greater");
return 0;
}

They're equal

They're equal

Var is greater

Var is greater

i is greater

i is greater

Compiler error.

Compiler error.

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

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
What is the output of the following code ?
#include<stdio.h>
int temp=20;
int main( )
{
printf("%d ",temp);
loo();
printf("%d ",temp);
loo();
printf("%d ",temp);
return 0;
}
void loo( )
{
static int temp=3;
printf("%d ",temp);
temp=temp+11;
}

20 20 20 20 20

20 20 20 20 20

20 3 14 14 25

20 3 14 14 25

20 3 20 14 20

20 3 20 14 20

20 3 20 23 34

20 3 20 23 34

Compilation error.

Compilation error.

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

Please login to submit your explanation

Start

Question 4

Time: 00:00:00
What is the expected output of the following code ?
#include<stdio.h>
int main( )
{
int temp=20;
printf("%d ",temp);
loo();
printf("%d ",temp);
loo();
printf("%d ",temp);
return 0;
}
void loo( )
{
int temp=3;
printf("%d ",temp);
temp=temp+11;
}

20 3 20 3 20

20 3 20 3 20

20 3 20 14 20

20 3 20 14 20

20 20 20 20 20

20 20 20 20 20

20 3 14 25 25

20 3 14 25 25

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 code below ?
#include<stdio.h>
int main()
{
plus(); plus(); plus();
return 0;
}
void plus()
{
static int var;
printf("%d", ++var);
}

012

012

123

123

000

000

111

111

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

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
A variable who's memory location is reserved  and it doesn't matter how many objects are instantiated is called a

volatile variable

volatile variable

const variable

const variable

extern variable

extern variable

static variable

static variable

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!"]
Hey ! Follow us on G+