C Multiple Choice Question.pdf

Share Embed Donate


Short Description

C Multiple Choice Question.pdf...

Description

C Multiple Choice Question

1 of 13

http://www.examblast.com/c-multiple-choice-question/index.html

Grockit GMAT Prep Personalized study plans. Free trial. Sign up now!

Pune Distance Education Distance Education Courses in Pune Enroll for Engineering, Mgmt Course

www.grockit.com/GMAT-Sample

www.Yeseducation.in/Pune

JOIN Forum For : JAVA | C | C++ | VC++ | XML | .NET | WebLogic | AquaLogic XML Exam XML Fill in Blanks

>> Question No. 1 --> void main() { int a=10,b=20; char x=1,y=0; if(a,b,x,y) { printf("EXAM"); } } What is the output? 1) 2) 3) 4)

XAM is printed exam is printed Compiler Error Nothing is printed

See Answer(s) of Question no. 1 Question No. 2 --> What is the result of 16>>2? 1) 2) 3) 4)

4 8 3 0

Data Base Multiple Choice DataBase Questions

See Answer(s) of Question no. 2

Win32 SDK Exam Win32 SDK Fill in Blank Win32 SDK True False Win32 SDK Match win32 SDK select the best choice win32 SDK Questions

Ads by Google C Pointer Element Predator Queue Piano Queue Stack

Web

examblast.com

Question No. 3 --> What is the output of the following code? #include void main() { char letter =`Z`; printf("\n%c",letter); } 1) 2) 3) 4)

Z 90 Error Garbage Value

See Answer(s) of Question no. 3 Question No. 4 --> What is the output of the following code?

06-09-2011 13:11

C Multiple Choice Question

2 of 13

http://www.examblast.com/c-multiple-choice-question/index.html

#include void main() { int s=0; while(s++ How can I dynamically allocate a two-dimensional array? 1) int **array1 = (int **)malloc(nrows * sizeof(int *)); for(i = 0; i < nrows; i++) array1[i] = (int *)malloc(ncolumns * sizeof(int)); 2) int **array2 = (int **)malloc(nrows * sizeof(int *)); array2[0] = (int *)malloc(nrows * ncolumns * sizeof(int)); for(i = 1; i < nrows; i++) array2[i] = array2[0] + i * ncolumns; 3) int *array3 = (int *)malloc(nrows * ncolumns * sizeof(int)); 4) Any of the above. See Answer(s) of Question no. 7 Question No. 8 --> main() { char thought[2][30]={"Don`t walk in front of me..","I am not follow"}; printf("%c%c",*(thought[0]+9),*(*(thought+0)+5)); } What is the output of this program? 1) 2) 3) 4)

kk Don`t walk in front of me I may not follow K

See Answer(s) of Question no. 8

06-09-2011 13:11

C Multiple Choice Question

3 of 13

http://www.examblast.com/c-multiple-choice-question/index.html

Question No. 9 --> #include void main() { int I=3,*j,**k; j=&I; k=&j; printf("%d%d%d",*j,**k,*(*k)); } What is the output of the above program code?

1) 444 2) 000 3) 333 4) 433

See Answer(s) of Question no. 9

Question No. 10 --> Which of the following is the correct way of declaring a float pointer: 1) 2) 3) 4)

float ptr; float *ptr; *float ptr; None of the above

See Answer(s) of Question no. 10 Question No. 11 --> The reason for using pointer is ... Choose the false option from the following sentences 1) 2) 3) 4)

Accessing arrays or string elements Dynamic memory allocation Implementing linked list,trees,graphs and many other data structures All are false

See Answer(s) of Question no. 11 Question No. 12 --> The size of a structure can be determined by a. size of variable name b. size of (struct tag) 1) 2) 3) 4)

Only a Only b Both a and b None of these options

See Answer(s) of Question no. 12 Question No. 13 --> main() { struct { int i; }xyz; (*xyz)->i=10; printf("%d",xyz.i); } What is the output of this program? 1) 2) 3) 4)

program will not compile 10 god only knows address of I

See Answer(s) of Question no. 13 Question No. 14 --> Pushdown list means: 1) Stack 2) Queue 3) Linked list

06-09-2011 13:11

C Multiple Choice Question

4 of 13

http://www.examblast.com/c-multiple-choice-question/index.html

4) All of the above See Answer(s) of Question no. 14 Question No. 15 --> What is time required to insert an element in a stack with linked implementation? 1) O( 1) 2) O(log2n) 3) O(n) 4) O(n log2n) See Answer(s) of Question no. 15 Question No. 16 --> Which of the following is the feature of stack? 1) 2) 3) 4)

All operations are at one end It cannot reuse its memory All elements are of different data types Any element can be accessed from it directly

See Answer(s) of Question no. 16 Question No. 17 --> To create a linked list, we can allocate space and make something point to it, by writing: struct-name *pointer-variable; Which of the following statement will correctly allocate the space 1) 2) 3) 4)

pointer-variable pointer-variable pointer-variable pointer-variable

= = = =

malloc(sizeof(*struct-name)); malloc(sizeof(struct struct-name)); alloc(sizeof(struct struct-name)); alloc(sizeof(*struct-name));

See Answer(s) of Question no. 17 Question No. 18 --> What result is achieved through the following code snippet? int initialize(NODE **circle) { if ((*circle = (NODE *)malloc(sizeof(NODE))) == NULL) return 0; (*circle)->next = NULL; (*circle)->previous = NULL; return 1; }

1) 2) 3) 4)

The node circle is assigned to NULL The size of the node circle is assigned to NULL Both the pointers next and previous are assigned to NULL None of these options

See Answer(s) of Question no. 18 Question No. 19 --> What would be the output of the following program? #include main() { char str[]="S\065AB"; printf("\n%d", sizeof(str)); }

1) 2) 3) 4)

7 6 5 error

See Answer(s) of Question no. 19 Question No. 20 --> fputs function is used to i. write characters to a file ii. takes 2 parameters iii. returns a character iv. requires a file pointer

06-09-2011 13:11

C Multiple Choice Question

5 of 13

http://www.examblast.com/c-multiple-choice-question/index.html

1) 2) 3) 4)

all are true all are false only i and ii are true only i,ii and iv are true

See Answer(s) of Question no. 20 Question No. 21 --> #include void main() { int a; printf("%d",a^a); } 1) 2) 3) 4)

1 0 Unexpected Runtime Error

See Answer(s) of Question no. 21 Question No. 22 --> Time taken for addition of element in queue is 1) 2) 3) 4)

O(1) O(n) O(log n) None of these options

See Answer(s) of Question no. 22 Question No. 23 --> To delete a dynamically allocated array named `a`, the correct statement is 1) 2) 3) 4)

delete delete delete delete

a; a[0]; []a; [0]a;

See Answer(s) of Question no. 23 Question No. 24 --> An entire structure or union variable can be assigned to another structure or union variable if 1) 2) 3) 4)

The two variables have the same composition. The two variables are of same type. Assignment of one structure or union variable to another is not possible. None of these options

See Answer(s) of Question no. 24 Question No. 25 --> What is the output of the following code? #include void swap(int&, int&); void main() { int a = 10,b=20; swap (a++,b++); printf("\n%d\t%d\t",a, b); } void swap(int& x, int& y) { x+=2; y+=3; }

1) 2) 3) 4)

14, 24 11, 21 10, 20 Error

See Answer(s) of Question no. 25 Question No. 26 --> What will be the value of `a` after the following code is executed #define square(x) x*x a = square(2+3) 1) 25 2) 13

06-09-2011 13:11

C Multiple Choice Question

6 of 13

http://www.examblast.com/c-multiple-choice-question/index.html

3) 11 4) 10 See Answer(s) of Question no. 26 Question No. 27 --> The five items: A, B, C, D and E are pushed in a stack,one after the other starting from A. The stack is popped four times and each element is inserted in a queue. Then two elements are deleted from the queue and pushed back on the stack. Now one item is popped from the stack. The popped item is. 1) 2) 3) 4)

A B C D

See Answer(s) of Question no. 27 Question No. 28 --> What is the output of the following code? #include void main() { int a=0,b=0; a = (b = 75) + 9; printf("\n%d, %d",a, b); } 1) 2) 3) 4)

75, 9 75, 84 84, 75 None of these options

See Answer(s) of Question no. 28 Question No. 29 --> Object Oriented Technology`s use of _________ facilitates the reuse of the code and architecture and its __________ feature provides systems with stability, as a small change in requirements does not require massive changes in the system: 1) 2) 3) 4)

Encapsulation; inheritance Inheritance; polymorphism Inheritance; encapsulation Polymorphism; abstraction

See Answer(s) of Question no. 29 Question No. 30 --> A recursive function would result in infinite recursion, if the following were left out: 1) 2) 3) 4)

Base case Recursive call Subtraction Local variable declarations

See Answer(s) of Question no. 30 Question No. 31 --> Which of the following are class relationships? 1) 2) 3) 4)

is-a relationship. Part-of relationship. Use-a relationship. All of these options.

See Answer(s) of Question no. 31 Question No. 32 --> In OOP`s, advantage of inheritance include. 1) 2) 3) 4)

Providing a useful conceptual framework. Avoiding rewriting a code. Facilitating class libraries. All of these options.

See Answer(s) of Question no. 32 Question No. 33 --> What is inheritance? 1) It is same as encapsulation. 2) Aggregation of information. 3) Generalization and specialization.

06-09-2011 13:11

C Multiple Choice Question

7 of 13

http://www.examblast.com/c-multiple-choice-question/index.html

4) All of these options. See Answer(s) of Question no. 33 Question No. 34 --> Object orientated programming allows for extension of an objects function or of class function. This ability within OOP is called ________________ . 1) 2) 3) 4)

extendibility expansion capacity virtual extension scalability

See Answer(s) of Question no. 34 Question No. 35 --> UML stands for 1) 2) 3) 4)

Unique Unified Unified Unified

modeling language. modeling language modern language master laqnguage

See Answer(s) of Question no. 35 Question No. 36 --> Which of the following programming technique focuses on the algorithm. 1) Procedural language 2) Object oriented language 3)Object based language 4) Structural language See Answer(s) of Question no. 36 Question No. 37 --> _______ provide useful conceptual framework. 1) 2) 3) 4)

Inheritance Polymorphysm Encapsulation None of these options

See Answer(s) of Question no. 37 Question No. 38 --> Which of the following is true: 1) 2) 3) 4)

Class is an object of an object. Class is meta class. Class cannot have zero instances. None of these options.

See Answer(s) of Question no. 38 Question No. 39 --> The design of classes in a way that hides the details of implementation from the user is known as: 1) 2) 3) 4)

Encapsulation Information Hiding Data abstraction All of these options

See Answer(s) of Question no. 39 ANSWERS --> Answer of Question No. 1 --> void main() { int a=10,b=20; char x=1,y=0; if(a,b,x,y) { printf("EXAM"); } } What is the output? 4) Nothing is printed



Goto Question no. 1 Answer of Question No. 2 --> What is the result of 16>>2?

06-09-2011 13:11

C Multiple Choice Question

8 of 13

http://www.examblast.com/c-multiple-choice-question/index.html

1) 2) 3) 4)

4 8 3 0

Goto Question no. 2 Answer of Question No. 3 --> What is the output of the following code? #include void main() { char letter =`Z`; printf("\n%c",letter); }

1) Z



Goto Question no. 3 Answer of Question No. 4 --> What is the output of the following code? #include void main() { int s=0; while(s++ How can I dynamically allocate a two-dimensional array? 1) int **array1 = (int **)malloc(nrows * sizeof(int *)); for(i = 0; i < nrows; i++) array1[i] = (int *)malloc(ncolumns * sizeof(int)); 2) int **array2 = (int **)malloc(nrows * sizeof(int *)); array2[0] = (int *)malloc(nrows * ncolumns * sizeof(int)); for(i = 1; i < nrows; i++) array2[i] = array2[0] + i * ncolumns; 3) int *array3 = (int *)malloc(nrows * ncolumns * sizeof(int)); 4) Any of the above. Goto Question no. 7

06-09-2011 13:11

C Multiple Choice Question

9 of 13

http://www.examblast.com/c-multiple-choice-question/index.html

Answer of Question No. 8 --> main() { char thought[2][30]={"Don`t walk in front of me..","I am not follow"}; printf("%c%c",*(thought[0]+9),*(*(thought+0)+5)); } What is the output of this program? 4) K



Goto Question no. 8 Answer of Question No. 9 --> #include void main() { int I=3,*j,**k; j=&I; k=&j; printf("%d%d%d",*j,**k,*(*k)); } What is the output of the above program code? 3) 333 Goto Question no. 9 Answer of Question No. 10 --> Which of the following is the correct way of declaring a float pointer: 2) float *ptr; Goto Question no. 10 Answer of Question No. 11 --> The reason for using pointer is ... Choose the false option from the following sentences 1) Accessing arrays or string elements



Goto Question no. 11 Answer of Question No. 12 --> The size of a structure can be determined by a. size of variable name b. size of (struct tag) 3) Both a and b



Goto Question no. 12 Answer of Question No. 13 --> main() { struct { int i; }xyz; (*xyz)->i=10; printf("%d",xyz.i); } What is the output of this program? 1) program will not compile



Goto Question no. 13 Answer of Question No. 14 --> Pushdown list means: 4) All of the above Goto Question no. 14 Answer of Question No. 15 --> What is time required to insert an element in a stack with linked implementation? 1) O( 1)



Goto Question no. 15 Answer of Question No. 16 --> Which of the following is the feature of stack?

06-09-2011 13:11

C Multiple Choice Question

10 of 13

http://www.examblast.com/c-multiple-choice-question/index.html

1) All operations are at one end Goto Question no. 16 Answer of Question No. 17 --> To create a linked list, we can allocate space and make something point to it, by writing: struct-name *pointer-variable; Which of the following statement will correctly allocate the space 1) 2) 3) 4)

pointer-variable pointer-variable pointer-variable pointer-variable

= = = =

malloc(sizeof(*struct-name)); malloc(sizeof(struct struct-name)); alloc(sizeof(struct struct-name)); alloc(sizeof(*struct-name));

Goto Question no. 17 Answer of Question No. 18 --> What result is achieved through the following code snippet? int initialize(NODE **circle) { if ((*circle = (NODE *)malloc(sizeof(NODE))) == NULL) return 0; (*circle)->next = NULL; (*circle)->previous = NULL; return 1; }

1) 2) 3) 4)

The node circle is assigned to NULL The size of the node circle is assigned to NULL Both the pointers next and previous are assigned to NULL None of these options

Goto Question no. 18 Answer of Question No. 19 --> What would be the output of the following program? #include main() { char str[]="S\065AB"; printf("\n%d", sizeof(str)); } 3) 5



Goto Question no. 19 Answer of Question No. 20 --> fputs function is used to i. write characters to a file ii. takes 2 parameters iii. returns a character iv. requires a file pointer

4) only i,ii and iv are true



Goto Question no. 20 Answer of Question No. 21 --> #include void main() { int a; printf("%d",a^a); } 2) 0



Goto Question no. 21 Answer of Question No. 22 --> Time taken for addition of element in queue is 3) O(log n) Goto Question no. 22 Answer of Question No. 23 -->

06-09-2011 13:11

C Multiple Choice Question

11 of 13

http://www.examblast.com/c-multiple-choice-question/index.html

To delete a dynamically allocated array named `a`, the correct statement is 1) delete a;



Goto Question no. 23 Answer of Question No. 24 --> An entire structure or union variable can be assigned to another structure or union variable if 1) 2) 3) 4)

The two variables have the same composition. The two variables are of same type. Assignment of one structure or union variable to another is not possible. None of these options

Goto Question no. 24 Answer of Question No. 25 --> What is the output of the following code? #include void swap(int&, int&); void main() { int a = 10,b=20; swap (a++,b++); printf("\n%d\t%d\t",a, b); } void swap(int& x, int& y) { x+=2; y+=3; } 4) Error



Goto Question no. 25 Answer of Question No. 26 --> What will be the value of `a` after the following code is executed #define square(x) x*x a = square(2+3) 3) 11 Goto Question no. 26 Answer of Question No. 27 --> The five items: A, B, C, D and E are pushed in a stack,one after the other starting from A. The stack is popped four times and each element is inserted in a queue. Then two elements are deleted from the queue and pushed back on the stack. Now one item is popped from the stack. The popped item is. 4) D Goto Question no. 27 Answer of Question No. 28 --> What is the output of the following code? #include void main() { int a=0,b=0; a = (b = 75) + 9; printf("\n%d, %d",a, b); } 3) 84, 75 Goto Question no. 28 Answer of Question No. 29 --> Object Oriented Technology`s use of _________ facilitates the reuse of the code and architecture and its __________ feature provides systems with stability, as a small change in requirements does not require massive changes in the system: 1) 2) 3) 4)

Encapsulation; inheritance Inheritance; polymorphism Inheritance; encapsulation Polymorphism; abstraction

Goto Question no. 29 Answer of Question No. 30 --> A recursive function would result in infinite recursion, if the following were left out: 1) 2) 3) 4)

Base case Recursive call Subtraction Local variable declarations

Goto Question no. 30

06-09-2011 13:11

C Multiple Choice Question

12 of 13

http://www.examblast.com/c-multiple-choice-question/index.html

Answer of Question No. 31 --> Which of the following are class relationships? 1) 2) 3) 4)

is-a relationship. Part-of relationship. Use-a relationship. All of these options.

Goto Question no. 31 Answer of Question No. 32 --> In OOP`s, advantage of inheritance include. 1) 2) 3) 4)

Providing a useful conceptual framework. Avoiding rewriting a code. Facilitating class libraries. All of these options.

Goto Question no. 32 Answer of Question No. 33 --> What is inheritance? 1) 2) 3) 4)

It is same as encapsulation. Aggregation of information. Generalization and specialization. All of these options.

Goto Question no. 33 Answer of Question No. 34 --> Object orientated programming allows for extension of an objects function or of class function. This ability within OOP is called ________________ . 1) 2) 3) 4)

extendibility expansion capacity virtual extension scalability

Goto Question no. 34 Answer of Question No. 35 --> UML stands for 2) Unified modeling language



Goto Question no. 35 Answer of Question No. 36 --> Which of the following programming technique focuses on the algorithm. 1) 2) 3) 4)

Procedural language Object oriented language Object based language Structural language

Goto Question no. 36 Answer of Question No. 37 --> _______ provide useful conceptual framework. 1) 2) 3) 4)

Inheritance Polymorphysm Encapsulation None of these options

Goto Question no. 37 Answer of Question No. 38 --> Which of the following is true: 1) 2) 3) 4)

Class is an object of an object. Class is meta class. Class cannot have zero instances. None of these options.

Goto Question no. 38 Answer of Question No. 39 --> The design of classes in a way that hides the details of implementation from the user is known as: 1) 2) 3) 4)

Encapsulation Information Hiding Data abstraction All of these options

Goto Question no. 39

06-09-2011 13:11

C Multiple Choice Question

13 of 13

http://www.examblast.com/c-multiple-choice-question/index.html

Ads by Google

C Pointer

Element

Predator Queue

Piano Queue

XML Exam XML Fill in Blanks

C++ Exam C++ Multiple Choice

XML Multiple Choice XML True False

Win32 SDK Exam Win32 SDK Fill in Blank

XML Match-Making

Win32 SDK True - False

DataBase Questions VC++ (MFC) Exam

Win32 SDK Match win32 select the best choice win32 SDK Questions Software Engg. Exam Software Engg. Select Best Choice C Exam

Multiple Choice Questions

C Programs

XML Questions Database Technologies Data Base Fill in Blanks Data Base True False Data Base Multiple Choice

Fill in the blanks True False

C Programming C Multiple Choice

WWW.EXAMBLAST.COM Copyright © 2006-2008 ExamBlast.com

06-09-2011 13:11

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF