Programming For Problem Solving Unit 1 Multiple Choice Questions MCQ

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

PROGRAMMING FOR PROBLEM SOLVING

Unit 1

Multiple Choice questions MCQ

1. Who is father of C Language? [CLO 1] [PLO1]


A. Bjarne Stroustrup B. Dennis Ritchie
C. James A. Gosling D. Dr. E.F. Codd
2. C Language developed at _____? [CLO 1] [PLO 1]
A. AT & T's Bell Laboratories of USA in 1972
B. AT & T's Bell Laboratories of USA in 1970
C. Sun Microsystems in 1973
D. Cambridge University in 1972

3. For 16-bit compiler allowable range for integer constants is ______ ? [CLO 1] [PLO 2]
A. -3.4e38 to 3.4e38
B. -32767 to 32768
C. -32768 to 32767
D. -32668 to 32667
4. C programs are converted into machine language with the help of [CLO 1] [PLO 1]
A. An Editor
B. A compiler
C. An operating system
D. None of the above
5. A C variable cannot start with [CLO 1] [PLO 1]
A. An alphabet
B. A number
C. A special symbol other than underscore
D. both (b) and (c)

6. Which of the following is allowed in a C Arithmetic Instruction? [CLO 1] [PLO 1]


A. []
B. {}
C. ()
D. None of the above
7. Which of the following shows the correct hierarchy of arithmetic
operations in C [CLO 1] [PLO 2]
A. / + * -
B. * -/ +
C. + - / *
D. * / + -

8. Program which is written originally by the programmer is classified as [CLO 1] [PLO 1]

A. object code
B. machine code
C. source program
D. interactive programs
9. Data types are differed on the basis of [CLO 1] [PLO 1]

A. the way of storage


B. the type of operations
C. the type of operators used
D. both a and b

10. Loop statement which is repeated for some given number of times is classified as [CLO 1]

A. FOR loop
B. GO loop
C. REPEAT loop
D. GO REPEAT loop

11. Type of statement written in sequence and is repeated until the specific condition met is
classified as [CLO 1] [PLO 1]

A. format
B. loop
C. case
D. condition

12. Size of an array is declared by [CLO 1] [PLO 1]

A. programmer
B. program users
C. software
D. declared automatically

13. Programming language 'FORTRAN' stands for [CLO 1] [PLO 1]

A. formula translator
B. formula translation
C. free translator
D. free translation

14. Functions that are used in the programs and are defined by the programmers are called
[CLO 1] [PLO 2]

A. program layout
B. program procedure
C. built-in functions
D. user-defined function
15. An assembler translates [CLO 1] [PLO 1]

A. machine code into assembly code


B. assembly code into machine code
C. processing time into manual time
D. routine into subroutine

16. Name given by a programmer to any particular data is classified as [CLO 1] [PLO 1]

A. identifier
B. identification
C. exponent
D. mantissa

17.When variable used in program is whole number, the variable is stored as [CLO 1] [PLO 2]

A. fixed string
B. integers
C. negative whole numbers
D. positive whole numbers

18. In programming, programmers use comments to [CLO 1] [PLO 1]

A. highlight program modules


B. explain module functions
C. explain used variables
D. all of above

19. Variable which uses the same name in whole program and in its all routines thus best classified
as [CLO 1] [PLO 2]

A. middle variable
B. default variable
C. local variable
D. global variable

20. Statement which is used to make choice between two options and only option is to be performed
is written as [CLO 1] [PLO 2]

A. if statement
B. if else statement
C. then else statement
D. else one statement
21. The__________ statement is used to transfer the control to the end of statement block in a loop:

a. Continue [CLO 1] [PLO 2]


b. Break
c. Switch
d. Goto
22. Which of the following is not a valid variable name declaration? [CLO 1] [PLO 2]
a) int _a3;
b) int a_3;
c) int 3_a;
d) int _3a

23. All keywords in C are in [CLO 1] [PLO 2]


a) LowerCase letters
b) UpperCase letters
c) CamelCase letters
d) None of the mentioned

24. Which of the following is true for variable names in C? [CLO 1] [PLO 2]
a) They can contain alphanumeric characters as well as special characters
b) It is not an error to declare a variable to be one of the keywords(like goto, static)
c) Variable names cannot start with a digit
d) Variable can be of any length

25. The format identifier ‘%i’ is also used for _____ data type? [CLO 1] [PLO 2]
a) char
b) int
c) float
d) double

26. Which of the following is a User-defined data type? [CLO 1] [PLO 3]


a) typedef int Boolean;
b) typedef enum {Mon, Tue, Wed, Thu, Fri} Workdays;
c) struct {char name[10], int age};
d) all of the mentioned

27. What is the output of this C code? [CLO 1] [PLO 3]

1. #include <stdio.h>
2. int main()
3. {
4. signed char chr;
5. chr = 128;
6. printf("%d\n", chr);
7. return 0;
8. }
a) 128
b) -128
c) Depends on the compiler
d) None of the mentioned

28. What is the output of this C code? [CLO 1] PLO 3]


1. #include <stdio.h>
2. int main()
3. {
4. j = 10;
5. printf("%d\n", j++);
6. return 0;
7. }

a) 10 b) 11
c) Compile time error d) 0
Explanation : j is not belongs to any data type

29. The following code ‘for( ; ; )’ represents an infinite loop.

It can be terminated by. [CLO 1] [PLO 3]


a) break b) exit(0)
c) abort() d) all of the mentioned

30. The keyword ‘break’ cannot be simply used within: [CLO 1] [PLO 3]
a) do-while b) if-else
c) for d) while

31. Which keyword is used to come out of a loop only for that iteration? [CLO 1] [PLO 3]
a) break b) continue
c) return d) none of the mentioned
32. The first step in problem solving is --------------- [CLO 1] [PLO 2]
a) Understand the problem c)Identify the problem
b) Developing algorithm/Flowchart d)Listing the possible outcome
33. The solutions which has series of actions to solve a problem are called ------ [CLO 1] [PLO 2]
a) Heuristic solutions
b) Algorithmic solutions
34. The solution can be reached by completing the actions in steps. These steps are called [CLO 1]
[PLO 2]
a) Sequence c)Algorithm
b) Flowchart d)Steps
35. Solutions that cannot be reached through a direct set of steps are called --------- [CLO 1][PLO 2]
a)Algorithmic solutions b) Heuristic solutions
36. ----------- means the outcome or the completed computer-assisted answer. [CLO 1][PLO 1]
a) Solution b) Result c) Program
37. The field of computer that deals with the problem of heuristic solution is called-----[CLO 1]
[PLO1]
a) Artificial Intelligence
b) Expert System c) Computer Management

38. ----------------- means the set of instructions that make up the solution after they have been coded
into a programming language. [CLO 1] [PLO1]
a) solution b) result c) program d) error

39. ---------------- are organized facts. [CLO 1] [PLO1]


a) Data b) Information

40. A language applied for wide range of application is called as ______language[CLO 1][PLO 2]

a. Special purpose c)General purpose


b. Individual purpose d)Scientific purpose

41. Compiler converts the source code into ______ [CLO 1][PLO 4]
a. C code b. Byte code c. Object code d. Executable code

42. ___________ converts source code to machine language one line at a time. [CLO 1][PLO 4]
a. Compiler b. Interpreter c. Assembler d.CPU

43. The program that converts high level language to a machine language is called __________
[CLO 1] [PLO 1]
a. Interpreter b. Linker c. Compiler d. Loader

44. ‘#’ symbol is known to be ______ [PLO 2] [CLO 1]


a. Linker b.Compiler c. Assembler d.Preprocessor directive

45. A _______ is a notational system for describing computations in both machine and human
readable form [PLO 1] [CLO 1]
a. Programming language c.Machine language
b. High-level language d.Assembly language

46. ----------------- program converts assembly language into machine language [PLO 2] [CLO 1]
a. compiler b. interpreter c. assembler d. preprocessor directive

47. which symbol is been used for processing in flowchart? Ans: a [CLO 1] [PLO 3]

a) b) c) d)

48. which symbol is been used for input/output in flowchart? Ans: c [PLO 3] [CLO 1]
a) b) c) d)

49. which symbol is been used for decision making in flowchart? Ans: d [PLO 3] [CLO 1]

a) b) c) d)

50. which is used as start/stop symbol in flowchart? Ans:b [PLO 3] [CLO 1]

a) b) c) d)

51. ------------ is a distinguishing characteristic of human excellence in every area of behavior


[CLO 1] [PLO 1]
a) creativity b) thinking c) visualization d) problem solving

52. .What is the value of x in this C code? [PLO 2] [CLO 1]


#include <stdio.h>
void main()
{
int x = 5 * 9 / 3 + 9;
}
(a). 3.75 b) Depends on compiler c) 24 d) 3

53.A character variable can store how many characters at a time? [PLO 2][CLO 1]
(a) 1 character
(b)8 characters
(c)255 character

54.Which of the following is the correct way of writing comments? [PLO 2] [CLO 1]
(a)*/comments/*
(b)/*comment*/
(c)**comment** (
d){comment}

55. C programming language is [PLO 1] [CLO 1]


(a)object oriented programming language (b)Procedure oriented programming language
(c)function oriented programming language (d)None of the above

56.The memory space taken for a char type data is [PLO 2] [CLO 1]
(a)2 bytes
(b)4 bytes
(c)8 bytes
(d)1bytes

57 .The memory space taken for a int type data is [PLO 2] [CLO 1]
(a) 2 bytes
(b) 4 bytes
(c) 8 bytes
(d)10bytes

58.The memory space taken for a float type data is [PLO 2] [CLO 1]
(a) 2 bytes
(b) 4 bytes
(c) 8 bytes
(d)10bytes

59. What is the only function all programs must contain ? [PLO 2] [CLO 1]
(a)start()
(b)system()
(c)main()
(d)program

60.For 16-bit compiler allowable range for integer constants is ________? [PLO 2] [CLO 1]
(a) -3.4e38 to 3.4e38
(b) -32767 to 32768
(c) -32668 to 32667
(d) -32768 to 32767

61.Every statement in C program is to be terminated by a__________ [PLO 2] [CLO 1]


(a)dot(.)
(b)semi-colon(;)
(c)colon(:)
(d)Question mark(?)

62 The escape sequence „\b‟ is a [PLO 2] [CLO 1]


(a)back space
(b)next line
(c)tab
(d)none of the above

63.The memory space taken for a long int type data is [PLO 2] [CLO 1]
(a) 2 bytes
(b) 4 bytes
(c) 8 bytes
(d)10bytes

64. which of the following will not valid expressions in C? [PLO2] [CLO 1]
(a) a=2+(b=5);
(b) a=11%3
(c) a=b=c=5
(d) b+5=2

You might also like