Programming for problem solving MCQs

Posted by

The "Answers" given with the Question is "not verified". To view Verified answers click on the button below.

Programming for problem solving… MCQs

1. Which of the following is a part of primary memory of computer
a) PROM
b) CD-ROM
c) Pen-drive
d) Floppy Disk

2. Which of the following is language processor?
(a) Compiler
(b) Interpreter
(c) Assembler
(d) All of these

3. Which protocol is used to transfer files on internet
a) HTTP
b) SMPT
c) FTP
d) Telnet

4. ALU is?
(a) Array Logic Unit
(b) Application Logic Unit
(c) Arithmetic Logic Unit
(d) None of these

5. Microprocessor of computer system is a part of :-
a) Memory
b) Output Device
c) Input Device
d) Processing Unit

6. Which of the programming language is said to be machine independent language?
(a) High Level language
(b) Machine Language
(c) Assembly Language
(d) Cobol Langugage

7. Which is not a font style in MS-Word
a) Bold
b) italic
c) Superscript
d) Regular

8. Which Translator can translate Assembly language program to Machine Language?
(a) Compiler
(b) Interpreter
(c) Debugger
(d) Assembler

9. With which of the following all formulas in excel starts?
a) /
b) $
c) *
d) =

10. Which one of the following is known as the ‘language of the computer’?
(a) Programming language
(b) High-level language
(c) Machine Language
(d) Assembly Language

11. Which of the following is not one of PowerPoint view?
a) Slide show view
b) Presentation view
c) Slide view
d) Outline view

12. Which is the critical component in any computer?
(a) Mouse
(b) DVD
(c) Keyboard
(d) Memory

13. In the evaluation of a computer language, all of the following characteristics should be considered except?
a) application oriented features
b) readability
c) efficiency
d) hardware maintenance costs

14. Which is reffered to as the brain of the computer?
(a) Processor
(b) RAM
(c) ROM
(d) Operating System

15. Keyboard is the type of device
A) Input
B) Pointing
C) Output
D) Sound

16. Which unit performs the all the arithmetic and logical operations in computer?
(a) CU (Control Unit)
(b) ALU (Arithmetic and logical Unit)
(c) Processor
(d) All of these

17. A document or image can be scanned in to digital form by using
A) Marker
B) Printer
C) Light pen
D) Scanner

18. Which standard is used to convert keystroke to corresponding bits
(a) ANSI
(b) EBCDIC
(c) ISO
(d) ASCII

19. HTML stands for
A) Hyper Text Makeup Language
B) Hyper Text Markup Language
C) Hyper Tech Markup Language
D) None of these

20. The memory capacity of a computer is represented in?
(a) Kilobits
(b) Kilobytes
(c) Memory chips
(d) None of above

21. Operating system is installed on
A) Hard Disk
B) Cache memory
C) Mother Board
D) None of these

22. Which of the following is non-volatile storage?
(a) Primary memory
(b) Secondary Storage
(c) Cache
(d) ROM

23. RAM stands for
(a) Read Access Memory
(b) Ready Application Module
(c) Random Access Memory
(d) Remote access machine

24. Recycle bin is used for
A) To store backup file
B) To restore deleted file / folder
C) To store most frequently
D) All the above

25. Keyboard is the _________ type of device?
(a) Printing
(b) Output
(c) Input
(d) Sound

26. The process a user goes through to begin a computer system.
A) Log out
B) Log in
C) Log off
D) None of these

27. Microprocessor of computer system is a part of __________
(a) Memory
(b) Output Device
(c) Input Device
(d) Processing Unit

28. Which among following is not necessary for working of a standalone computer?
A) RAM
B) Hard Drive
C) Operating System
D) LAN card

29. The ALU of a computer responds to the commands coming from
(a) Primary Memory
(b) Control Section
(c) External Memory
(d) Cache Memory

30. What is algorithm?
a) Application code
b) Type of programming language
c) None of above
d) Step by step procedure for calculations

31. Where the data and programs stored when the processor uses them?
(a) Main Memory
(b) Secondary Memory
(c) Disk Memory
(d) Hard Disk

32. EEPROM stands for
(a) Electrically erasable Programmable Read-Only Memory
(b) Easily Erasable Programmable ReadOnly Memory
(c) Electrically Erasable Programmable Read-Only Memory
(d) None of these

33. To Learn Computer, without going to classroom what will be other way
a) Distance Learning
b) I-Learning
c) Digital Learning
d) E-Learning

34. Software required to run the hardware is known as
(a) Task Manager
(b) Task Bar
(c) Program Manager
(d) Device Driver

35. How to write E_mailAddress ?
a) xyz@website.info
b) xyz@website@info
c) xyz.website.info
d) xyzwebsite.info

36. Which software is used to operate the computer hardware and to provide a platform for running application software
(a) System Software
(b) Software
(c) Operating System
(d) System Software

37. What will be a meaning of 1KB of memory
a) 1 Kit Bit
b) 1 Kilo Byte
c) 1 Kernel Boot
d) 1 Key Block

38. Which type of software are specific to user’s need?
(a) Application Software
(b) System Software
(c) Software
(d) Operating System

39. What is Computer Virus ?
a) Software
b) Hardware
c) a and b
d) None of above

40. Full form of IP ?
a) Internet Principle
b) Intercom Protocol
c) Intranet Protocol
d) Internet Protocol

41. What will be extension of Web Page’s file ?
a) .xls
b) .3gp
c) .html
d) .ppt

42. Software required to run the hardware is known as
(a) Task Manager
(b) Task Bar
(c) Program Manager
(d) Device Driver

43. Which the following is application software?
(a) Compiler
(b) Power Point
(c) Debugger
(d) None of the above

44. Which of the programming language is said to be machine independent language?
(a) High Level Language
(b) Machine Language
(c) Assembly Language
(d) All the Above

45. Which of the following is smallest Network?
(a) MAN
(b) LAN
(c) WAN
(d) PAN

46. FTP stands for
(a) File Transport Protocol
(b) File Transfer Protocol
(c) Folder Transfer Protocol
(d) Folder Transport Protocol

47. When a key is pressed on keyboard, which standard is used for converting the keystroke into the corresponding bits
(a) ANSI
(b) ASCII
(c) EBCDIC
(d) ISO

48. Which one is input device?
A) Monitor
B) Keyboard
C) CPU
D) Printer

49. Which part of CPU perform calculations and make decision
A) Alternate Logic Unit
B) Arithmetic Logic Unit
C) Arithmetic Local Unit
D) Alternate Local Unit

50. The memory capacity of a computer is represented in
A) Kilobits
B) Kilobytes
C) Memory chips
D) None of the above

51. HTML is used to design
A) Webpage
B) Website
C) Multimedia Objects
D) Tables and frames

52. What type of memory is volatile?
A) Cache
B) RAM
C) ROM
D) Hard Drive

53. With regards to Email Addresses:
A) They must always contain an @ symbol
B) They are case insensitive
C) They can never contain space
D) All of above

54. Which of the following will you find on an inkjet printer ?
(A) It has an ink ribbon.
(B) It has an ink cartridge.
(C) It has high voltage power supply.
(D) It uses toner powder

55. Why is it important to keep Windows updated using the Windows update website or automatic updates?
(A) To keep your system secure and to install critical updates.
(B) To keep your system fast.
(C) To keep your system optimized for the new game.
(D) To keep your system from overheating.

56. Which protocol used to display web pages?
(A) SNMP
(B) SMPT
(C) Telnet
(D) HTTP

57. In Microsoft Excel you can use the horizontal and vertical scroll bar to
(A) Split a worksheet to two panes
(B) Edit the contents of a cell
(C) View different rows and columns
(D) View different worksheet

58. The system unit of a personal Computers typically contains all of the following except:
(A) Microprocessors
(B) Disk controller
(C) Serial interface
(D) Modem

59. Which of the following is a read only memory storage device?
(A) Floppy Disc
(B) CD-ROM
(C) Hard Disk
(D) None of these

60. BIOS is an abbreviation of
(A) Basic Input Output System
(B) Best Input Output System
(C) Basic Input Output Symbol
(D) Base Input Output System

61. A Pointer is?
(A) A keyword used to create variables.
(B) A variable that stores address of an instruction.
(C) A variable that stores address of other variable.
(D) All of above.

62. What do you call the translator which takes assembly language program as inputand produce machine language code as output?
(A) Compiler
(B) Interpreter
(C) Debugger
(D) Assembler

63. Which header file is essential for using scanf() function?
(a) ctype.h
(b) string.h
(c) conio.h
(d) stdio.h

64. Which of the following is known as the ‘language of the computer’?
(a) Programming language
(b) High level Language
(c) Machine language
(d) Assembly language

65. In flow char for what purpose <> symbol is used?
a) Processing
b) Condition
c) Data flow
d) Input/output

66. Which one is an input device?
(a) Monitor
(b) Printer
(c) Mouse
(d) Plotter

67. Which the following is an application software?
(a) Compiler
(b) MS Word
(c) Assembler
(d) Interpreter

68. ______ is generally used to increase the apparent size of physical memory.
(a) Secondary memory
(b) Virtual memory
(c) Hard-disk
(d) Disks

69. printf() belongs to which library of c
a) stdlib.h
b) stdio.h
c) stdout.h
d) stdoutput.h

70. What will be printed if we type the statement printf(“%d\n”,’d’);
a) 0
b) 100
c) error
d) d

71. C is a __________ language.
a) High level
b) Middle level
c) Machine level
d) Low level

72. Which header file is essential for using printf() function ?
a) text.h
b) strings.h
c) stdio.h
d) strcmp.h

73. A declaration float a,b; occupies ______of memory ?
(a) 1 bytes
(b) 4 bytes
(c) 8 byte
(d) 16 bytes

74. What are the different types of real data types in C?
(A) float, double.
(B) short int, double, long int.
(C) double, long int, float
(D) float, double, long double

75. Which of the following is a symbol for Logical AND operator?
(A) ||
(B) &&
(C) $$
(D) &

76. Which of the following is a correct statement?
(A) Variable name must start with underscore
(B) Variable name must have digit
(C) Variable name must have white space character
(D) Keyword cannot be a variable name

77. A declaration float sum, value; occupies of memory?
(a) 2 byte
(b) 4 byte
(c) 6 byte
(d) 8 byte

78. Any C program
a) Must contain at least one function
b) Need not contain any function.
c) Needs input data
d) None of the above

79. What should be written in the program to get newline on the screen?
(a) printf(“\n”);
(b) echo\\n;
(c) printf(‘\n’);
(d) printf(\\n);

80. Which is a correct C expression?
(a) Z = (x+y);
(b) Z = [x+y];
(c) Z = {x+y};
(d) Z = {(x+y)};

81. If we want to increment the value of sum by 1. Which of following should be used?
(a) sum++;
(b) sum = sum+1;
(c) sum+=1;
(d) all of above

82. A float requires ______bytes in memory
(a) 2 bytes
(b) 1 byte
(c) 8 bytes
(d) 4 bytes

83. What is the value of expression 4/9 in C?
(a) 1
(b) 0
(c) 0.444
(d) Error

84. A declaration float a,b; occupies how much memory?
(a) 2 bytes
(b) 4 bytes
(c) 8 bytes
(d) 16 bytes

85. To round off x, which is a float, to an int value, which one is correct?
(a) y = (int)(x+0.5)
(b) y = int(x+0.5)
(c) y = (int)x+0.5
(d) y = (int) ((int)x+0.5)

86. Which data type allows storage of same data type?
(a) Array
(b) Union
(c) Void
(d) both a and b

87. What is the output of 16>>2?
(a) 4
(b) 32
(c) 8
(d) 64

88. Which of this have highest Precedence?
(a) ()
(b) ++
(c) *
(d) >>

89. Storage of Character Variable is:
(a) 2 byte
(b) 1 byte
(c) 8 byte
(d) 0 byte

90. The format string to accept a string is
(a) %c
(b) %d
(c) %f
(d) %s

91. File manipulation functions in C are available in which header file?
(a) streams.h
(b) stdio.h
(c) stdlib.h
(d) files.h

92. All macro substitutions in a program are done?
a) Before compilation of the program
b) During execution
c) After compilation
d) None of the above

93. Macros with arguments are not allowed.
a) TRUE
b) May Be
c) FALSE
d) Can’t Say

94. A macro must always be written in capital letters.
a) TRUE
b) May Be
c) FALSE
d) Can’t Say

95. If ptr is a pointer to int, having value ptr=100. After ptr++, what is the value of ptr?
(a)100
(b)101
(c)102
(d)103

96. Address stored in the pointer variable is of type ________
(a) Integer
(b) Floating
(c) Hexadecimal
(d) Character

97. ………… is the method used by card sorter.
a) Radix sort
b) Insertion
c) Heap
d) Quick

98. Partition and exchange sort is ……..
a) quick sort
b) tree sort
c) heap sort
d) bubble sort

99. Which of the following is a disadvantage of linear search?
a) Requires more space
b) Greater time complexities compared to other searching algorithms
c) Not easy to understand
d) All of the mentioned

100. Consider the array A[]= {5,4,9,1,3} apply the insertion sort to sort the array Consider the cost associated with each sort is 25 rupees, what is the total cost of the insertion sort for sorting the entire array?
a) 25
b) 50
c) 75
d) 100

101. The first expression in a for… loop is
a) Step value of loop
b) Value of the counter variable
c) Condition statement
d) None of the above

102. Continue statement used for
a) To continue to the next line of code
b) To stop the current iteration and begin the next iteration from the beginning
c) To handle run time error
d) None of above

103. Which of the following loop is executed at least once?
a) do-while
b) for
c) if
d) while

104. Which among the following is a unconditional control structure.
a) goto
b) for
c) do-while
d) if-else

105. Which of the following is ternary operator?
(a) ??
(b) ?:
(c) 😕
(d) ::

106. ASCII value of ‘A’ is .
(a) 55
(b) 75
(c) 65
(d) 85

107. Which are not looping structures?
(a) Forloop
(b) Do…whileloop
(c) Whileloop
(d) if…else

108. How many times the following code prints the string “hello”
for(i=1;i<=50;i++);
{
printf(“Hello”);
}
(a)1
(b)Zero
(c)50
(d) None ofthem

109. Which of following is not a valid assignment expression?
(a) Y =22;
(b) s = x ;
(c) y % = 6;
(d) z=5=3;

110. How many times the following loop will be executed.
main( )
{
int i = 32766;
while(i<=32767)
{
printf(“%d\n”,i);
i = i +1;
}
}
(a) 2 times
(b) 1 times
(c) Infinite time
(d) loop will not be executed

111. What is the output of the following code:
void main()
{
int i;
for(i=1;i<=10;i++);
{
printf(“%d\n”,i);
}
}
(a) 10
(b) 1 to 10
(c) 11
(d) None of the above

112. What is the output of the following code:
void main()
{
int i;
for(i=65;i<70;i++)
{
printf(“%c,”,i);
}
}
(a) 65,66,67,68,69,70
(b) a,b,c,d,e,
(c) A,B,C,D,E
(d) A,B,C,D,E

113. What is the output of the following code:
void main()
{
int i=5;
switch(i)
{
case 3: printf(“three”);
case 4: printf(“four”);
case 5: printf(“five”);
case 6: printf(“six”);break;
case 7: printf(“seven”);
default: printf(“default”);
}
}
(a)five
(b)fivesixsevendefault
(c) fivesix
(d) None of the above

114. ASCII value of ‘a’ is
(a) 97
(b) 65
(c) 47
(d) None of the above

115. Break statement is used for
(a) Quit a program
(b) Both a and b
(c) Quit the current iteration
(d) None of the above

116. Which one is the correct syntax of for loop?
(a) for(initialization, condition, increment/decrement)
(b) for(initialization; condition; increment/decrement)
(c) for(condition, condition, increment/decrement)
(d) for(condition; initilization; increment/decrement)

117. What is the output of following C code?
int k;
for(k=1;k>=10;k++);
printf(“Hello”);
(a) prints “Hello” 10 times
(b) prints nothing
(c) prints “Hello” infinite times
(d) prints “Hello” 1 time

118. For loop is _________.
(a)Function Controlled Loop
(b)Exit Controlled Loop
(c)Entry Controlled Loop
(d) None of these

119. What will be the output of following code.
{
int x = 10, y=15;
x = x++;
y = ++y;
printf(“%d, %d \n” , x, y);
}
(a) 10, 15
(b) 10, 16
(c) 11, 16
(d) 11, 15

120. Which of the following is used as a string termination character?
(a) 0
(b) \0
(c) /0
(d) None of these

121. Which of the following function is more appropriate for reading in a multi word string?
(a) printf();
(b) scanf();
(c) gets();
(d) puts();

122. Array index start at
(a) 1
(b) User Defined
(c) 0
(d) None of above

123. Every string is terminated by NULL character. How it is represented?
(a) ‘\0’
(b) NULL
(c) both a and b
(d) None of above

124. The format string to accept a string is
(a)%c
(b)%d
(c)%f
(d)%s

125. Which header file is necessary for strlen() function?
(a)conio.h
(b)strings.h
(c)string.h
(d)stdio.h

126. Recursion is a process in which a function calls
(a) itself
(b) another function
(c) main() function
(d) none of the above

127. When function calls itself, it is known as .
(a) Recursion
(b) exit control loop
(c) Nested loop
(d) user defined function

128. A pointer value refers to
a) A float value
b) An integer constant
c) Any valid address in memory
d) None

129. If ptr is a pointer to int, having value ptr=100. After ptr++, what is the value of ptr?
(a) 100
(b) 102
(c) 101
(d) 103

130. What is the output of the following C code?
int main()
{
int *ptr,a=10;
ptr = &a;
*ptr +=1;
printf(“%d%d\n”,*ptr,a);
}
(a) 10,10
(b) 10,11
(c) 11,10
(d) 11,11

131. Address stored in the pointer variable is of type _________
(a) Character
(b) Integer
(c) Floating
(d) Array

132. Structure can contain elements of the different data type
(a) true
(b) false

133. Which of the following operator is used to select a member of a structure variable
(a) .(dot)
(b) ,(comma)
(c) : (colon)
(d) ;(semicolon)

134. Default value of global variable is
(a) 0
(b) Garbage value
(c) 1
(d) Depend on datatype

135. Default value of local variable is
(a) Garbage value
(b) 0
(c) 1
(d) Depend on data type

136. MACRO is used to _______
(a) Save memory
(b) Both a & c
(c) fast execution
(d) none of above

137. Which of the following operator is used to select a member of a structure variable
(a) .(dot)
(b) ,(comma)
(c) : (colon)
(d) ;(semicolon)

138. What is the output of the following code:
void main()
{
enum day { Mon,Tue,Wed,Thu,Fri,Sat,Sun};
printf(“%d”,Fri);
getch();
}
(a) 5
(b) Error
(c) 4
(d) Fri

139. Difference between calloc() and malloc()
a) calloc() takes a single argument while malloc() needs two arguments
b) malloc() takes a single argument while calloc() needs two arguments
c) malloc() initializes the allocated memory to ZERO
d) calloc() initializes the allocated memory to NULL

140. Which function reallocates memory?
(a) realloc
(b) calloc
(c) malloc
(d) None of these

141. Which function should be used to release allocated memory which is not needed?
(a) dealloc
(b) free()
(c) release()
(d) unalloc()

142. File manipulation functions in C are available in which header file?
(a) streams.h
(b) stdio.h
(c) stdlib.h
(d) files.h

143. When fopen() fails to open a file it returns
(a) NULL
(b) 1
(c) -1
(d) None of above

144. Which function is used to put the file pointer at the desired location in the file?
(a) fseek()
(b) rewind()
(c) ftell()
(d) fptr()