C Data Types 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
What is the expected output of the C code ?
#include<stdio.h>
int main()
{
float radius = 7;
printf ("The perimeter of the circle is %.2f", 2*(22/7)*radius);
return 0;
}

The perimeter of the circle is 42.00

The perimeter of the circle is 42.00

The perimeter of the circle is 44.00

The perimeter of the circle is 44.00

The perimeter of the circle is 0.00

The perimeter of the circle is 0.00

Compilation error.

Compilation 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 will be printed by the following code ?
#include <stdio.h>
int main()
{
char a = 'Z';

printf("%d", a);

return 0;
}

Compiler error.

Compiler error.

90

90

26

26

1

1

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

Please login to submit your explanation

Start

Question 3

Time: 00:00:00
In c size of a pointer and int is same.

TRUE

TRUE

FALSE

FALSE

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 output of the code given below ?
#include<stdio.h>
int main()
{
void *p, n;
n = 0;
p = &n;
printf("%v", *p);
return 0;
}

0.

0.

Garbage value.

Garbage value.

(null).

(null).

Compiler error.

Compiler error.

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

Please login to submit your explanation

Start

Question 5

Time: 00:00:00
Given that size of a char is 1 byte and negatives are stored in 2's compliment. What will be the output of the following program ?
#include<stdio.h>
int main()
{
char v = 125;
v = v+16;
printf("%d", v);
return 0;
}

141

141

-14

-14

Compiler error.

Compiler error.

-115

-115

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

Please login to submit your explanation

Start

Question 6

Time: 00:00:00
What is the output of the given code ?
#include <stdio.h>
int main()
{
if (sizeof(int) > -14)
printf("Yes ");
else
printf("No ");

if (sizeof(int) > 3)
printf("Yes ");
else
printf("No ");
return 0;
}

Yes Yes

Yes Yes

No No

No No

Yes No

Yes No

No Yes

No Yes

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 correct output of the following program ?
#include<stdio.h>
int main()
{
float x = 0.1;
if ( x = 0.1 )
printf("first");
else if (x = 0.1f)
printf("second");
else
printf("third");
}

first

first

second

second

third

third

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

Please login to submit your explanation

Start

Question 8

Time: 00:00:00
What is the expected output of the following program ?
#include<stdio.h>
int main()
{
float x = 0.1;
if ( x == 0.1 )
printf("first");
else if (x == 0.1f)
printf("second");
else
printf("third");
}

first

first

second

second

third

third

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

Please login to submit your explanation

Start

Question 9

Time: 00:00:00
Select the correct output of the C code below.
#include<stdio.h>
int main()
{
float x = 0.1;
if ( x == 0.1 )
printf("first");
else if (x == 0.2f)
printf("second");
else
printf("third");
}

first

first

second

second

third

third

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

Please login to submit your explanation

Start

Question 10

Time: 00:00:00
What is the expected output of the following code?
#include<stdio.h>
int main()
{
float x = 0.1;
if ( x == 0.1 )
printf("first");
else if (x = 0.2f)
printf("second");
else
printf("third");
}

first

first

second

second

third

third

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!"]