You are on page 1of 12

QUIZ 1

1. The _______ provides pictorial representation of given problem.

A. Algorithm
B. Flowchart
C. Pseudocode
D. All of these
2. Which of the following retains the information it’s storing when the power to the system is
turned off?
a) CPU  
b) ROM
c) RAM
d) DIMM
3. Which of the following statement is correct?

a) 1 KB = 1024 bytes
b) 1 MB=2048 bytes
c) 1 MB = 1000 kilobytes
d) 1 KB = 1000 bytes
4. The _______ symbol is used to represent decision in flowchart.
A. Circle
B. Rectangle
C. Diamond
D. None of these
5. A byte is equivalent to
a) 2 bits
b) 6 bits
c) 8 bits
d) 10 bits
6. A standard computer keyboard has how many keys?
a) 84
b) 94
c) 104
d) 114
7. The program written by the programmer in high level language is called _____________
a) Object Program
b) Source Program
c) Assembled Program
d) Compiled Program
8. ASCII stands for _____________________

a) American standard code for information interchange


b) American scientific code for information interchange
c) American scientific code for international interchange
d) American standard code of international interchange
9.  Convert : (101)2 = ( __ )10.
a) 4 b) 5 c) 6 d) 9

10. The hexadecimal representation of 14 is _______________


a) A b) F c) D d) E

11. The binary equivalent of the decimal number 10 is __________


a) 0010 b) 10 c) 1010 d) 010
12. Convert : (110)2 = ( __ )10.
a) 4 b) 5 c) 6 d) 9

13.The decimal equivalent of (0.101)2 will be ____________


a) 0.5 b) 0.625 c) 0.25 d) 0.875

14. The hexadecimal representation of 10 is _______________


a) A b) F c) D d) E

15. Convert the binary equivalent 10101 to its decimal equivalent.


a) 21 b) 12 c) 22 d) 31

16.What could be the maximum value of a single digit in an octal number system?
a) 8 b) 7 c) 6 d) 5

17. The maximum number of bits sufficient to represent an octal number in binary is _______
a) 4 b) 3 c) 7 d) 8

18. Convert (22)8 into its corresponding decimal number.


a) 28
b) 18
c) 81
d) 82

19. The octal equivalent of the binary number (0010010100)2 is ______________


a) 422
b) 242
c) 224
d) 226

20. Convert (5401)8 to hexadecimal.


a) A01 b) A02 c) B01 d) C01
QUIZ 2
1. Who is the father of C language?
a) Steve Jobs
b) James Gosling
c) Dennis Ritchie
d) Rasmus Lerdorf

2. Which of the following is not a valid C variable name?


a) int number;
b) float rate;
c) int variable_count;
d) int $main;

3. All keywords in C are in ____________


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

4. Which of the following is true for variable names in C?


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

5. Which is valid C expression?


a) int my_num = 100,000;
b) int my_num = 100000;
c) int my num = 1000;
d) int $my_num = 10000;

6. Which of the following cannot be a variable name in C?


a) volatile
b) true
c) friend
d) export

7. What is short int in C programming?


a) The basic data type of C
b) Qualifier
c) Short is the qualifier and int is the basic data type
d) All of the mentioned

8. Which of the following declaration is not supported by C language?


a) String str;
b) char *str;
c) float str = 3e2;
d) Both “String str;” and “float str = 3e2;”
9. Which keyword is used to prevent any changes in the variable within a C program?
a) immutable
b) mutable
c) const
d) volatile

10. What is the result of logical or relational expression in C?


a) True or False
b) 0 or 1
c) 0 if an expression is false and any positive number if an expression is true
d) None of the mentioned

11. Which of the following typecasting is accepted by C language?


a) Widening conversions
b) Narrowing conversions
c) Widening & Narrowing conversions
d) None of the mentioned

12. Where in C the order of precedence of operators do not exist?


a) Within conditional statements, if, else
b) Within while, do-while
c) Within a macro definition
d) None of the mentioned

13. Which of the following is NOT possible with any 2 operators in C?


a) Different precedence, same associativity
b) Different precedence, different associativity
c) Same precedence, different associativity
d) All of the mentioned

14. What is an example of iteration in C?


a) for
b) while
c) do-while
d) all of the mentioned

15. Functions can return enumeration constants in C?


a) true
b) false
c) depends on the compiler
d) depends on the standard

16. Functions in C Language are always _________


a) Internal
b) External
c) Both Internal and External
d) External and Internal are not valid terms for functions
17. Which of following is not accepted in C?
a) static a = 10; //static as
b) static int func (int); //parameter as static
c) static static int a; //a static variable prefixed with static
d) all of the mentioned

18. Property which allows to produce different executable for different platforms in C is
called?
a) File inclusion
b) Selective inclusion
c) Conditional compilation
d) Recursive macros

19. What is #include <stdio.h>?


a) Preprocessor directive
b) Inclusion directive
c) File inclusion directive
d) None of the mentioned

20. C preprocessors can have compiler specific features.


a) True
b) False
c) Depends on the standard
d) Depends on the platform
QUIZ 3

1. Which of the following are C preprocessors?


a) #ifdef
b) #define
c) #endif
d) all of the mentioned

2. The C-preprocessors are specified with _________ symbol.


a) #
b) $
c) ” ”
d) &

3. How is search done in #include and #include “somelibrary.h” according to C


standard?
a) When former is used, current directory is searched and when latter is used, standard
directory is searched
b) When former is used, standard directory is searched and when latter is used, current
directory is searched
c) When former is used, search is done in implementation defined manner and when
latter is used, current directory is searched
d) For both, search for ‘somelibrary’ is done in implementation-defined places

4. How many number of pointer (*) does C have against a pointer variable declaration?
a) 7
b) 127
c) 255
d) No limits

5. Which of the following is not possible statically in C language?


a) Jagged Array
b) Rectangular Array
c) Cuboidal Array
d) Multidimensional Array

6. Which of the following return-type cannot be used for a function in C?


a) char *
b) struct
c) void
d) none of the mentioned

7. The standard header _______ is used for variable list arguments (…) in C.
a) <stdio.h >
b) <stdlib.h>
c) <math.h>
d) <stdarg.h>
8. When a C program is started, O.S environment is responsible for opening file and
providing pointer for that file?
a) Standard input
b) Standard output
c) Standard error
d) All of the mentioned

9. In C language, FILE is of which data type?


a) int
b) char *
c) struct
d) None of the mentioned

10. What is the sizeof(char) in a 32-bit C compiler?


a) 1 bit
b) 2 bits
c) 1 Byte
d) 2 Bytes

11. Which of the following is not an operator in C?


a) ,
b) sizeof()
c) ~
d) None of the mentioned

12. scanf() is a predefined function in______header file.


a) stdlib. h
b) ctype. h
c) stdio. h
d) stdarg. h

13. Which of the following are themselves a collection of different data types?
a) string
b) structures
c) char
d) all of the mentioned

14. User-defined data type can be derived by___________


a) struct
b) enum
c) typedef
d) all of the mentioned

15. The format identifier ‘%i’ is also used for _____ data type.
a) char
b) int
c) float
d) double
16. Which data type is most suitable for storing a number 65000 in a 32-bit system?
a) signed short
b) unsigned short
c) long
d) int

17. Which of the following is a User-defined data type?


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

18. What is the size of an int data type?


a) 4 Bytes
b) 8 Bytes
c) Depends on the system/compiler
d) Cannot be determined

19. What is short int in C programming?


a) The basic data type of C
b) Qualifier
c) Short is the qualifier and int is the basic data type
d) All of the mentioned

20. What is the precedence of arithmetic operators (from highest to lowest)?


a) %, *, /, +, –
b) %, +, /, *, –
c) +, -, %, *, /
d) %, +, -, *, /
QUIZ 4

1. Which of the following is not an arithmetic operation?


a) a * = 10;
b) a / = 10;
c) a ! = 10;
d) a % = 10;

2. Which of the following data type will throw an error on modulus operation(%)?
a) char
b) short
c) int
d) float

3. Which among the following are the fundamental arithmetic operators, i.e, performing
the desired operation can be done using that operator only?
a) +, –
b) +, -, %
c) +, -, *, /
d) +, -, *, /, %

4. A string is terminated by ___.

A. Newline ('\n')
B. Null ('\0')

C. Whitespace
D. None of the above

5. Which format specifier is used to read and print the string using printf() and
scanf() in C?

A. %c
B. %str

C. %p
D. %s

6. Which function is used to read a line of text including spaces from the user in
C?

A. scanf()
B. getc()

C. fgets()
D. All of the above
7. Which function is used to concatenate two strings in C?

A. concat()
B. cat()
C. stringcat()

D. strcat()

8. Which function is used to compare two strings in C?

A. strcmp()
B. strcmpi()

C. compare()
D. cmpi()

9. Which is the correct syntax to declare an array in C?

A. data_type array_name[array_size];
B. data_type array_name{array_size};
C. data_type array_name[];

D. All of the above

10. You can access elements of an array by ___.

A. values
B. indices

C. memory addresses
D. All of the above

11. Array elements are always stored in ___ memory locations.

A. Random
B. Sequential

C. Both A and B
D. None of the above
12.  If we pass an array as an argument to a function, what actually gets passed?

A. Value of elements in array


B. First element of the array
C. Base address of the array i.e., the address of the first element

D. Address of the last element of array

13. Which of these is a user-defined data type in C?

A. int
B. union
C. char

D. All of these

14. Which of the following are valid decision-making statements in C?

A. if
B. switch

C. nested if
D. All of these

15. Decision making in the C programming language is ___.

A. Repeating the same statement multiple times


B. Executing a set of statements based on some condition
C. Providing a name of the block of code

D. All of these

16. Which of the following is a true value in C programming?

A. 1
B. "includehelp"

C. ! NULL
D. All of these

17. Ternary operator in C programming is ___.

A. if-else-if
B. ? :
C. ? ; ?

D. None of these

18. What is the correct syntax of if statement in C program?

A. if(condition){
}
B. if(condition) :
C. If { [condition] }

D. None of these

19. The if statement is a conditional statement?

A. True
B. False

20. When the condition of if statement is false, the flow of code will ___.

A. go into the if block


B. Exit the program

C. Continue the code after skipping the if block


D. None of these

You might also like