Question 1

Time: 00:00:00
What is the output of C Program?


int main()
{
int k, j;

for(k=1, j=10; k <= 5; k++)
{
printf("%d ", (k+j));
}

return 0;
}

compiler error

compiler error

10 10 10 10 10

10 10 10 10 10

11 12 13 14 15

11 12 13 14 15

None of the above

None of the above

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

Please login to submit your explanation

Question 2

Time: 00:00:00
What will be the output of the following C code?


int main()
{
short i;
for (i = 1; i >= 0; i++)
printf("%d\n", i);

}

The control won’t fall into the for loop

The control won’t fall into the for loop

Numbers will be displayed until the signed limit of short and throw a runtime error

Numbers will be displayed until the signed limit of short and throw a runtime error

Numbers will be displayed until the signed limit of short and the program will successfully terminate

Numbers will be displayed until the signed limit of short and the program will successfully terminate

This program will get into an infinite loop and keep printing numbers with no errors

This program will get into an infinite loop and keep printing numbers with no errors

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

Please login to submit your explanation

Question 3

Time: 00:00:00
What is the output of C Program.?


int main()
{
while(true)
{
printf("RABBIT");
break;
}

return 0;
}


RABBIT

RABBIT

RABBIT is printed unlimited number of times

RABBIT is printed unlimited number of times

No output

No output

Compiler error.

Compiler error.

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

Please login to submit your explanation

Question 4

Time: 00:00:00
What is the output of C Program.?


int main()
{
int a=0, b=0;
while(++a < 4)
printf("%d ", a);

while(b++ < 4)
printf("%d ", b);

return 0;
}


0 1 2 3 1 2 3 4

0 1 2 3 1 2 3 4

1 2 3 1 2 3 4

1 2 3 1 2 3 4

1 2 3 4 1 2 3 4

1 2 3 4 1 2 3 4

1 2 3 4 0 1 2 3

1 2 3 4 0 1 2 3

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

Please login to submit your explanation

Question 5

Time: 00:00:00
What is the output of C Program.?


int main()
{
int k;

for(printf("FLOWER "); printf("YELLOW "); printf("FRUITS "))
{
break;
}

return 0;
}


Compiler error

Compiler error

FLOWER FRUITS

FLOWER FRUITS

FLOWER YELLOW

FLOWER YELLOW

FLOWER YELLOW FRUITS

FLOWER YELLOW FRUITS

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

Please login to submit your explanation

Question 6

Time: 00:00:00
What is the output of C Program.?


int main()
{
int k, j;

for(k=1, j=10; k <= 5; k++)
{
printf("%d ", (k+j));
}

return 0;
}


compiler error

compiler error

10 10 10 10 10

10 10 10 10 10

11 12 13 14 15

11 12 13 14 15

None of the above

None of the above

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

Please login to submit your explanation

Question 7

Time: 00:00:00
What is the output of C Program.?


int main()
{
int a=32;

do
{
printf("%d ", a);
a++;
if(a > 35)
break;
}while(1);

return 0;
}


No Output

No Output

32 33 34

32 33 34

32 33 34 35

32 33 34 35

Compiler error

Compiler error

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

Please login to submit your explanation

Question 8

Time: 00:00:00


#include
int main()
{
int sum = 23;

for(int i = 2; i <= 5; i++ )
{
for(int j = i; j <= 5; j++ )
{
printf("i = %d " , i );
printf("j = %d " , j);
printf("\n");
}
}

return 0;
}


  i = 2 j = 1 i = 2 j = 2 i = 2 j = 3 i = 2 j = 4 i = 2 j = 5 i = 3 j = 1 i = 3 j = 2 i = 3 j = 3

  i = 2 j = 1 i = 2 j = 2 i = 2 j = 3 i = 2 j = 4 i = 2 j = 5 i = 3 j = 1 i = 3 j = 2 i = 3 j = 3

i = 2 j = 2 i = 2 j = 3 i = 2 j = 4 i = 2 j = 5 i = 3 j = 3 i = 3 j = 4 i = 3 j = 5 i = 4 j = 4 i = 4 j = 5 i = 5 j = 5

i = 2 j = 2 i = 2 j = 3 i = 2 j = 4 i = 2 j = 5 i = 3 j = 3 i = 3 j = 4 i = 3 j = 5 i = 4 j = 4 i = 4 j = 5 i = 5 j = 5

Compilation error since variable i can not be used in the inner for loop.

Compilation error since variable i can not be used in the inner for loop.

None of these

None of these

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

Please login to submit your explanation

Question 9

Time: 00:00:00
What will be the output of the following C code?


#include
void main()
{
int k = 0;
for (k)
printf("Hello this is prepinsta");
}


Compile time error

Compile time error

hello

hello

Nothing

Nothing

Varies

Varies

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

Please login to submit your explanation

Question 10

Time: 00:00:00
What will be the output of the following C code?


#include
int main()
{
int sum = 23;

for(int i = 2; i <= 5; i++ )
{
for(int j = 7; j <= 9; j++ )
{
sum += ( i * j);
}
}
printf("%d",sum);

return 0;
}


234

234

359

359

224

224

None of these

None of these

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