0% found this document useful (0 votes)
96 views

Java MCQ

The document discusses integer ranges in 16-bit compilers and recursive functions in C programs. It provides explanations and answers for three multiple choice questions: 1) the allowable integer range for 16-bit compilers is -32768 to 32767, 2) a program that recursively calls the main function without a base case will result in the output printing indefinitely, and 3) C programs require at least one function.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views

Java MCQ

The document discusses integer ranges in 16-bit compilers and recursive functions in C programs. It provides explanations and answers for three multiple choice questions: 1) the allowable integer range for 16-bit compilers is -32768 to 32767, 2) a program that recursively calls the main function without a base case will result in the output printing indefinitely, and 3) C programs require at least one function.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1) What is the 16-bit compiler allowable range for integer constants?

a. -3.4e38 to 3.4e38
b. -32767 to 32768
c. -32668 to 32667
d. -32768 to 32767

Answer: (d) -32768 to 32767

Explanation: In a 16-bit C compiler, we have 2 bytes to store the value.

o The range for signed integers is -32768 to 32767.


o The range for unsigned integers is 0 to 65535.
o The range for unsigned character is 0 to 255.

Study the following program:

1. main()  
2. {printf("javatpoint");  
3. main();}  

What will be the output of this program?

a. Wrong statement
b. It will keep on printing javatpoint
c. It will Print javatpoint once
d. None of the these

Answer: (b) It will keep on printing javatpoint

Explanation: In this program, the main function will call itself again and again.
Therefore, it will continue to print javatpoint.

3) What is required in each C program?

a. The program must have at least one function.


b. The program does not require any function.
c. Input data
d. Output data
Answer: (a) The program must have at least one function.

Explanation: Any C program has at least one function, and even the most trivial
programs can specify additional functions. A function is a piece of code. In other words,
it works like a sub-program.

You might also like