Free C++ Test

void *ptr;

myStruct myArray[10];

ptr = myArray;


char* myFunc (char *ptr)

{

ptr += 3;

return (ptr);

}

int main()

{

char *x, *y;

x = "HELLO";

y = myFunc (x);

printf ("y = %s \n", y);

return 0;

}


struct node *nPtr, *sPtr; /* pointers for a linked list. */

for (nPtr=sPtr; nPtr; nPtr=nPtr->next)

{

free(nPtr);

}

The sample code above releases memory from a linked list. Which of the choices below accurately describes how it will work?


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("%d,%d,%d,%d",b,a++,a,++a);

what will be the output when following code is executed


int x[] = { 1, 4, 8, 5, 1, 4 };

int *ptr, y;

ptr = x + 4;

y = ptr - x;

What does y in the sample code above equal?


void myFunc (int x)

{

if (x > 0)

myFunc(--x);

printf("%d, ", x);

}

int main()

{

myFunc(5);

return 0;

}

What will the above sample code produce when executed?


11 ^ 5

What does the operation shown above produce?


#define MAX_NUM 15

Referring to the sample above, what is MAX_NUM


Which one of the following functions is the correct choice for moving blocks of binary data that are of arbitrary size and position in memory?


int x = 2 * 3 + 4 * 5;

What value will x contain in the sample code above?


int var1;

If a variable has been declared with file scope, as above, can it safely be accessed globally from another file?


time_t t;

Which one of the following statements will properly initialize the variable t with the current time from the sample above?


int x = 0;

for (x=1; x<4; x++);

printf("x=%d\n", x);

What will be printed when the sample code above is executed?


int x = 3;

if( x == 2 );

x = 0;

if( x == 3 )

x++;

else x += 2;

What value will x contain when the sample code above is executed?


char *ptr;

char myString[] = "abcdefg";

ptr = myString;

ptr += 5;

What string does ptr point to in the sample code above?


x = 3, counter = 0;

while ((x-1))

{

++counter;

x--;

}

Referring to the sample code above, what value will the variable counter have when completed?


char ** array [12][12][12];

Consider array, defined above. Which one of the following definitions and initializations of p is valid?


char buf [] = "Hello world!";

char * buf = "Hello world!";

In terms of code generation, how do the two definitions of buf, both presented above, differ?


Which one of the following will read a character from the keyboard and will store it in the variable c?

































































































Description:

This is Objective Type Test

Tags:

c++ test  c++  test

Comments
pradeep singh
By: pradeep singh
678 days 19 hours 6 minutes ago

hard paper.i will give next time

anshu patel
By: anshu patel
673 days 4 hours 15 minutes ago

keep qsn changing and show explanation with the results

swapnil kshirsagar
By: swapnil kshirsagar
619 days 17 hours 58 minutes ago

very hard yarrrrr

sangeeta
By: sangeeta
590 days 18 hours 56 minutes ago

it's tough..

M
By: M
553 days 20 hours 56 minutes ago

qustion 17 has a wrong answer (x=2; should be x=1;)
C Borland compiler :)

Best regards
Piotr

SHASHANK AGARWAL
By: SHASHANK AGARWAL
547 days 23 hours 37 minutes ago

i hv got 16 .....
very intresting.......

Santhosh
By: Santhosh
523 days 23 hours 50 minutes ago

Gud one

max
By: max
482 days 17 hours 44 minutes ago

question 5 gives me 22,13,14,14 ?!?!?

max
By: wlochaty
409 days 14 hours 58 minutes ago

This question is wrong (no correct answer to check). The result of this operation is UNDEFINED!!!
It can be 22,13,13,13 or 22,13,14,14 or any other ...

max
By: pavithra
142 days 7 hours 34 minutes ago

inside printf action takes frm back side

sonal
By: sonal
475 days 16 hours 9 minutes ago

very good test

JAGMOHAN
By: JAGMOHAN
459 days 13 minutes ago

l

sushmitha
By: sushmitha
449 days 6 hours 2 minutes ago

5th ans is wrong

sushmitha
By: sushmitha
449 days 5 hours 55 minutes ago

nice paper

latha
By: latha
366 days 14 hours 37 minutes ago

plz show d xplanations

Kewal
By: Kewal
343 days 14 hours 53 minutes ago

Hey i got 18 correct n 2 wrong

prashant kumar singh
By: prashant kumar singh
340 days 2 hours 50 minutes ago

very nice effort for professional or who knows little bit about programming in advance but not for beginners.......

ojom pandey
By: ojom pandey
332 days 16 hours 48 minutes ago

very good test

ojom pandey
By: ojom pandey
332 days 16 hours 48 minutes ago

very good test

jitendra rajput
By: jitendra rajput
285 days 19 hours 55 minutes ago

just update new questions,and also put solution

jitendra rajput
By: jitendra rajput
285 days 19 hours 55 minutes ago

just update new questions,and also put solution

Want to learn?

Sign up and browse through relevant courses.

Name:
Your Email:
Password:
Country:
Contact no:


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


Sign Up Already a member? Sign In
I agree to WizIQ's User Agreement & Privacy Policy
Ramkrushna Shelke
Software Developer(Max Secure AntiVirus Pvt. Ltd.)
User
31 Followers

Your Facebook Friends on WizIQ

More Tests By Author

Multiple choice questions in C
20 Questions | 128 Attempts

TEST IN C
5 Questions | 5019 Attempts

Explore Similar Courses

Program in C++

Price:$149

Give live classes, create & sell online courses

Try it free Plans & Pricing

Connect