# OBJECTIVE C (25 Questions) online Test

#include&lt;stdio.h&gt;

void main()

{

int x = 3, counter = 0;

while ((x-1))

{

++counter;

x--;

}

printf(&quot;%d&quot;,counter);

}

#include&lt;stdio.h&gt;

void main()

{

int x = 5;

int y = 2;

char op = &apos;*&apos;;

switch (op)

{

default : x += 1;

case &apos;+&apos; : x += y;

case &apos;-&apos; : x -= y;

}

printf(&quot;%d&quot;,x);

}

#include&lt;stdio.h&gt;

#include&lt;math.h&gt;

void main()

{

double x = -3.5, y = 3.5;

printf( &quot;%.0f : %.0f\n&quot;, ceil( x ), ceil( y ) );

printf( &quot;%.0f : %.0f\n&quot;, floor( x ), floor( y ) );

}

#include&lt;stdio.h&gt;

#include&lt;math.h&gt;

void main()

{

int x = 3;

if( x == 2 );

x = 0;

if( x == 3 )

x++;

else x += 2;

printf(&quot;%d&quot;,x);

}

#include&lt;stdio.h&gt;

void main()

{

int x = 0;

for (x=1; x&lt;4; x++);

printf(&quot;x=%d\n&quot;, x);

}

What is a difference between a declaration and a definition of a variable?

int testarray[3][2][2] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12};

What value does testarray[2][1][0] in the sample code above contain?

int a=10,b;

b=a++ + ++a;

printf(&quot;%d,%d,%d,%d&quot;,b,a++,a,++a);

#include&lt;stdio.h&gt;

void myFunc (int x)

{

if (x &gt; 0)

myFunc(--x);

printf(&quot;%d&quot;,x);

}

int main()

{

myFunc(5);

return 0;

}

11 ^ 5

What does the operation shown above produce?

int x = 2 * 3 + 4 * 5;

What value will x contain in the sample code above?

#include &lt;stdio.h&gt;

int i;

void increment( int i )

{

i++;

}

int main()

{

for( i = 0; i &lt; 10; increment( i ) )

{

}

printf(&quot;i=%d\n&quot;, i);

return 0;

}

int x = 0;

for ( ; ; )

{

if (x++ == 4)

break;

continue;

}

printf(&quot;x=%d\n&quot;, x);

char txt [20] = &quot;Hello world!\0&quot;;

How many bytes are allocated by the definition above?

penny = one

nickel = five

dime = ten

quarter = twenty-five

How is enum used to define the values of the American coins listed above?

#include&lt;stdio.h&gt;

void main()

{

int i = 4;

int x = 6;

double z;

z = x / i;

printf(&quot;z=%.2f\n&quot;, z);

}

Which one of the following is valid for opening a read-only ASCII file?

short int x; /* assume x is 16 bits in size */

What is the maximum number that can be printed using printf(&quot;%d\n&quot;, x), assuming that x is initialized as shown above?

#include &lt;stdio.h&gt;

void func()

{

int x = 0;

static int y = 0;

x++; y++;

printf( &quot;%d -- %d\n&quot;, x, y );

}

int main()

{

func();

func();

return 0;

}

c = getchar();

What is the proper declaration for the variable c in the code above?

main()

{

float me = 1.1;

double you = 1.1;

if(me==you)

printf(&quot;I love U&quot;);

else

printf(&quot;I hate U&quot;);

}

main()

{

int i=-1,j=-1,k=0,l=2,m;

m=i++&amp;&amp;j++&amp;&amp;k++||l++;

printf(&quot;%d %d %d %d %d&quot;,i,j,k,l,m);

}

main()

{

int c=- -2;

printf(&quot;c=%d&quot;,c);

}

#define int char

main()

{

int i=65;

printf(&quot;sizeof(i)=%d&quot;,sizeof(i));

}

main()

{

int i=10;

i=!i&gt;14;

Printf (&quot;i=%d&quot;,i);

}

Description:

for Placement Purpose

Tags:

Want to learn?

or fill this simple form
Name:
Country:
Contact no.:

Area code Number
Subjects you are interested in:
Word verification: (Enter the text as shown in image)

### More Tests By Author

C objective
11 Questions | 125 Attempts

Price:\$100
\$49

Price:\$199

Price:\$90
\$59

SAVE 35%

Connect