Exercise

1. How many keywords are there in c ?

A. 31
B. 32
C. 64
D. 63

View Answer

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

A. Variable names cannot start with a digit
B. Variable can be of any length
C. They can contain alphanumeric characters as well as special characters
D. Reserved Word can be used as variable name

View Answer


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

A. true
B. friend
C. export
D. volatile

View Answer


4. By default a real number is treated as a

A. float
B. double
C. long double
D. far double

View Answer


5. The format identifier ā€˜%iā€™ is also used for _____ data type?

A. char
B. int
C. float
D. double

View Answer


6. Variable names beginning with underscore is not encouraged. Why?

A. It is not standardized
B. To avoid conflicts since assemblers and loaders use such names
C. To avoid conflicts since library routines use such names
D. To avoid conflicts with environment variables of an operating system

View Answer


7. What is size of int in C ?

A. 2 bytes
B. 4 bytes
C. 8 bytes
D. Depends on the system/compiler

View Answer


8. Range of double is -1.7e-38 to 1.7e+38 (in 16 bit platform - Turbo C under DOS)

A. True
B. False

View Answer


9. Which is false?

A. Constant variables need not be defined as they are declared and can be defined later
B. Global constant variables are initialized to zero
C. const keyword is used to define constant values
D. You cannot reassign a value to a constant variable

View Answer


10. Array is ______ data type in C Programming language.

A. Derived Data type
B. Primitive Data type
C. Custom Data type
D. None of these

View Answer


11. If you pass an array as an argument to a function, what actually gets passed?

A. Address of last element of Array
B. Value of first element
C. Base address of array
D. Value of elements in array

View Answer


12. When double is converted to float, the value is?

A. Rounded
B. Truncated
C. Depends on the standard
D. Depends on the compiler

View Answer


13. Which of the following is not a logical operator?

A. !
B. &&
C. ||
D. |

View Answer


14. Which of the following can have different meaning in different contexts?

A. &
B. *
C. Both A and B
D. None of the above

View Answer


15. Which of the following is not a valid declaration in C?
    1. short int x;
    2. signed short x;
    3. short x;
    4. unsigned short x;

A. 1 and 2
B. 2 and 4
C. 3 and 4
D. All are valid

View Answer


16.The minumum number of temporary variable needed to swap the content two variables is?

A. 2
B. 3
C. 0
D. 1

View Answer


17.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

View Answer



Discussion

* You must be logged in to add comment.