Question 1

Time: 00:00:00
What is the output of this C code?

#include <stdio.h>
void main()
{
static int i;
printf(“i is %d”, i);
}

1

1

Garbage Value

Garbage Value

Runtime Error

Runtime Error

Zero

Zero

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

Please login to submit your explanation

Question 2

Time: 00:00:00
What is the output of this C code?

#include <stdio.h>
int *i;
int main()
{
if (i == NULL)
printf(“true\n”);
return 0;
}

true

true

true only if NULL value is 0

true only if NULL value is 0

Compile time error

Compile time error

Nothing

Nothing

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

Please login to submit your explanation

PrepInsta User

if we execute the bove program ..it will not be excecuted.It will shows the compile time error.so the above answer is wrong.

Question 3

Time: 00:00:00
What is the output of this C code?

#include <stdio.h>
static int i;
void main()
{
int i;
printf(“i is %d”, i);
}

Garbage Value

Garbage Value

Runtime Error

Runtime Error

Nothing

Nothing

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

Please login to submit your explanation

PrepInsta User

Answer should be 0. (compiled and verified)

Question 4

Time: 00:00:00
What is the output of this C code?

#include <stdio.h>
static int x = 5;
void main()
{
x = 9;
{
int x = 4;
}
printf(“%d”, x);
}

9

9

4

4

5

5

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

Please login to submit your explanation

Question 5

Time: 00:00:00
The scope of an automatic variable is:

Within the block it appears

Within the block it appears

Within the blocks of the block it appears

Within the blocks of the block it appears

Until the end of program

Until the end of program

Within the block it appears & Within the blocks of the block it appears

Within the block it appears & Within the blocks of the block it appears

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

Please login to submit your explanation

Question 6

Time: 00:00:00
Automatic variables are allocated space in the form of a:

stack

stack

queue

queue

priority queue

priority queue

random

random

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

Please login to submit your explanation

Question 7

Time: 00:00:00
Which of the following is a storage specifier?

enum

enum

union

union

auto

auto

volatile

volatile

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

Please login to submit your explanation

Question 8

Time: 00:00:00
Automatic variables are stored in

stack

stack

data segment

data segment

register

register

heap

heap

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

Please login to submit your explanation

Question 9

Time: 00:00:00
What is the output of this C code?

#include <stdio.h>
int main()
{
register int i = 10;
int *q = &i;
*q = 11;
printf(“%d %d\n”, i, *q);
}

Depends on whether i is actually stored in machine register

Depends on whether i is actually stored in machine register

10 10

10 10

11 11

11 11

Compile time error

Compile time error

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

Please login to submit your explanation

Question 10

Time: 00:00:00
Register storage class can be specified to global variables

True

True

False

False

Depends on the compiler

Depends on the compiler

Depends on the standard

Depends on the standard

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

Please login to submit your explanation

Question 11

Time: 00:00:00
Register variables reside in

stack

stack

registers

registers

heap

heap

main memory

main memory

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

Please login to submit your explanation

Question 12

Time: 00:00:00
Which of the following operation is not possible in a register variable?

Reading the value into a register variable

Reading the value into a register variable

Copy the value from a memory variable

Copy the value from a memory variable

Global declaration of register variable

Global declaration of register variable

All of the mentioned

All of the mentioned

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

Please login to submit your explanation

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

Personalized Analytics only Availble for Logged in users

Analytics below shows your performance in various Mocks on PrepInsta

Your average Analytics for this Quiz

Rank

-

Percentile

0%

Get over 200+ Courses under One Subscription

mute

Don’t settle Learn from the Best with PrepInsta Prime Subscription

Learn from Top 1%

One Subscription, For Everything

The new cool way of learning and upskilling -

Limitless Learning

One Subscription access everything

Job Assistance

Get Access to PrepInsta Prime

Top Faculty

from FAANG/IITs/TOP MNC's

Get over 200+ course One Subscription

Courses like AI/ML, Cloud Computing, Ethical Hacking, C, C++, Java, Python, DSA (All Languages), Competitive Coding (All Languages), TCS, Infosys, Wipro, Amazon, DBMS, SQL and others.

Comments