Explore topic-wise MCQs in Cairn.

This section includes 48 Mcqs, each offering curated multiple-choice questions to sharpen your Cairn knowledge and support exam preparation. Choose a topic below to get started.

1.

How will you free the memory allocated by the following program?  #include<stdio.h> #include<stdlib.h> #define MAXROW 3 #define MAXCOL 4 int main() {      int **p, i, j;      p = (int **) malloc(MAXROW * sizeof(int*));      return 0; }

A. memfree(int p);
B. dealloc(p);
C. malloc(p, 0);
D. free(p);
Answer» E.
2.

What is x in the following program?  #include<stdio.h> int main() {      typedef char (*(*arrfptr[3])())[10];      arrfptr x;      return 0; }

A. x is a pointer
B. x is an array of three pointer
C. x is an array of three function pointers
D. Error in x declaration
Answer» D. Error in x declaration
3.

In the following code, the P2 is Integer Pointer or Integer?  typedef int *ptr; ptr p1, p2;

A. Integer
B. Integer pointer
C. Error in declaration
D. None of the above
Answer» C. Error in declaration
4.

What do the 'c' and 'v' in argv stands for?

A. c means argument control v means argument vector
B. c means argument count v means argument vertex
C. c means argument count v means argument vector
D. c means argument configuration v means argument visibility
Answer» D. c means argument configuration v means argument visibility
5.

___________ programs automatically connects to web sites and download documents and save them to local drive.

A. Web Servers
B. Web Downloading Utilities
C. Offline Browsers
D. None of these
Answer» C. Offline Browsers
6.

Which of the following language is used to write animation and games in browser ?

A. None of these
B. C Programming
C. HTML
D. Java
Answer» E.
7.

Software which allows user to view the webpage is called as __________.

A. Operating System
B. Internet Browser
C. Website
D. Interpreter
Answer» C. Website
8.

Computer that requests the resources or data from other computer is called as ________ computer.

A. Server
B. Client
Answer» C.
9.

________ programs are automatically loaded and operates as a part of browser.

A. Plug-ins
B. Utilities
C. Add-ons
D. Widgets
Answer» B. Utilities
10.

Data Structure in which one predecessor may have one or more successor , that data structure is called as __________.

A. Non Primitive Data Structure
B. Primitive Data Structure
C. Linear Data Structure
D. Non Linear Data Structure
Answer» E.
11.

Select non linear data structures from the list of following data structures ! [Select appropriate options]

A. Array
B. Graphs
C. Linked List
D. None of these
Answer» C. Linked List
12.

In _________ data structure , data contain hierarchical and network relationship between elements.

A. Non linear
B. Linear
Answer» B. Linear
13.

Array is an example of ________ data structure.

A. Linear Data Structure
B. Non Linear Data Structure
Answer» B. Non Linear Data Structure
14.

In linear data structure each and every element have unique predecessor and unique successor !

A. False
B. True
Answer» C.
15.

If elements of the data structure forms a sequence of list then it is called as ____________.

A. Primitive data structure
B. None of these
C. Non-primitive data structure
D. Linear data structure
Answer» E.
16.

Non Primitive data Structures are those which define set of _________.

A. Static Elements
B. None of these
C. Primitive Elements
D. Derived Elements
Answer» E.
17.

Primitive data Structures are generally _________ data types in programming language.

A. Built in Data Types
B. User Defined Data Types
Answer» B. User Defined Data Types
18.

_________________ defines a set of primitive elements which do not involves any other element as its sub-part.

A. Primitive Data Structure
B. Non-Primitive Data Structure
C. Non Linear Data Structure
D. Linear Data Structure
Answer» B. Non-Primitive Data Structure
19.

ADT is called as Abstract because -

A. It is collection of different data types
B. It is completely independent data type
C. Implementation Details are hidden
D. None of these
Answer» D. None of these
20.

In what kind of storage we can easily insert,delete,concatenate and rearrange substrings ?

A. Stack
B. Linked List
C. Array
D. Queue
Answer» C. Array
21.

Variable which can be accessed by all modules of the program is called as __________.

A. Auto Variable
B. Local Variable
C. Global Variable
D. Static Variable
Answer» D. Static Variable
22.

Abstract data type is representation of data structure in the memory !

A. False
B. True
Answer» C.
23.

Mathematical Model that can have set of operations that can be performed on that model is called as _________.

A. None of these
B. Composite Data Type
C. Abstract Data Type
D. Primitive Data Type
Answer» D. Primitive Data Type
24.

Data that can be broken down into small pieces and each sub-field having the some meaning is called as ___________.

A. Dynamic Data
B. Textual Data
C. Composite Data
D. Atomic Data
Answer» D. Atomic Data
25.

Atomic Data is also called as _____________.

A. None of these
B. Scalar Data
C. Textual Data
D. Dynamic Data
Answer» C. Textual Data
26.

Single and non-decomposable data is called ______________.

A. Atomic Data
B. Numeric Data
C. Textual Data
D. Composite Data
Answer» B. Numeric Data
27.

In data structure, data may be of __ types.

A. 4
B. 1
C. 3
D. 2
Answer» E.
28.

Data is nothing but ____________.

A. Piece of Information
B. None of these
C. Programming Statement
D. Bunch of Information
Answer» B. None of these
29.

Term Data Structure refers to _________ and interrelationship between them.

A. None of these
B. Organization of data element
C. Coding Standards
D. Programming Language Statement
Answer» C. Coding Standards
30.

Point out error in the following code - #include<stdio.h> int main() { int x = 50, y = 100; if(x = = y) printf("x is equal to y\n"); else if(x > y) printf("x is greater than y\n"); else if(x < y) printf("x is less than y\n")l return 0; }

A. Error: R-Value Required
B. Error: Statement missing Semicolon
C. Error: Expression syntax
D. Error: L-Value Required
Answer» E.
31.

How many times loop will get executed ? #include<stdio.h> int main() { int i = 0; while(i <= 255) { printf("%d", i); i++; } return 0; }

A. 255 Times
B. 256 Times
C. Infinite Times
D. 1 Time
Answer» C. Infinite Times
32.

Guess the output of the program ? #include<stdio.h> int main() { int i = 1, j = 2; if(i = 1) && if(j = 2) printf("India is my country"); return 0; }

A. Error : Expression Syntax Error
B. No output and No Error
C. Error: Undeclared identifier if
D. Error: Misplaced If
Answer» E.
33.

Predict the output of the program ? #include<stdio.h> int main() { if(printf("ABC")) printf("True"); else printf("False"); return 0; }

A. ABC
B. ABCTrue
C. ABCFalse
D. True
Answer» C. ABCFalse
34.

What will be printed if we execute following program ? #include<stdio.h> int main() { float a = 0.3; if(0.3 > a) printf("True\n"); else printf("False\n"); return 0; }

A. None of these
B. True
C. True False
D. False
Answer» E.
35.

Guess the output of the program ? #include<stdio.h> int main() { int a=0, b=1, c=2; *((a+1 == 1) ? &b : &a) = a ? b : c; printf("%d, %d, %d\n", a, b, c); return 0; }

A. 1,1,2
B. 0,1,2
C. 2,2,2
D. 0, 2, 2
Answer» E.
36.

Guess the output of the following program : #include<stdio.h> int main() { int x = 10; float y = 10.0; if(x == y) printf("x and y are equal"); else printf("x and y are not equal"); return 0; }

A. Compile Error
B. x and y are equal
C. Run Time Error
D. x and y are not equal
Answer» C. Run Time Error
37.

Guess the output of the following program ? #include<stdio.h> int main() { int a = 100, b = 200, c = 300; if(!a >= 500) b = 300; c = 400; printf("%d,%d,%d",a, b, c); return 0; }

A. 100,200,400
B. 100,300,400
C. 100,200,300
D. 100,300,300
Answer» B. 100,300,400
38.

Find output of the following program ? #include<stdio.h> int main() { char str[] = "Smaller"; int a = 100; printf(a > 10 ? "Greater" : "%s", str); return 0; }

A. 100
B. Compile Error
C. Greater
D. Smaller
Answer» D. Smaller
39.

How many times below for loop will be executed ? #include<stdio.h> int main() { int i=0; for(;;) printf("%d",i); return 0; }

A. 0 times
B. 1 times
C. 10 times
D. Infinite times
Answer» E.
40.

Which Committee standardize C Programming Language ?

A. ISO
B. TRAI
C. ANSI
D. W3C
Answer» D. W3C
41.

Who was Creator of B Language , which inspired Dennis Ritchie to create Strong Procedural Language called C ?

A. James Gosling
B. John W. Backus
C. Ken Thompson
D. Brian Kernighan
Answer» D. Brian Kernighan
42.

Ritchie and Brian Kernighan jointly carried out the development of C and that version is ________ .

A. K&R C
B. R&K C
C. ANSI C
D. ISO C
Answer» B. R&K C
43.

C Programming was created in Year _______ .

A. 1980
B. 1972
C. 1967
D. 1976
Answer» C. 1967
44.

Dennis Ritchie received following awards - [Select 2]

A. Turing Award for their development of generic operating systems theory
B. Albert Einstein World Award of Science
C. Nobel Prize
D. Sony Radio Academy Awards
Answer» B. Albert Einstein World Award of Science
45.

Many features of C were derived from an earlier language called _____.

A. B
B. BCPL
C. BASIC
D. PASCAL
Answer» B. BCPL
46.

Dennis Was Author of Famous Programming Book _________ .

A. C Programming for Scientist
B. C Programming and Techniques
C. Learn C Step By Step
D. The C Programming Language
Answer» E.
47.

C Programming was created at ______ by Dennis Ritchie.

A. Haward University
B. MIT University
C. Stanford Lab
D. AT&T Bell Laboratory
Answer» E.
48.

'this' pointer is _____________________ .

A. Pointer to the current object created in all static and non-static methods
B. Pointer to the current object created for the current class
C. Both A and B
D. Pointer to the current object created in all non-static methods
Answer» E.