Join our Telegram Channel

8000+ STATIC GK MCQs for SSC/ Railway/ PSC
1000 POLITICAL SCIENCE MCQS | EBook
Get 22 nos. GK EBooks | Combo Pack
Current Affairs Monthly Magazine -Subscribe Now!
1000 BIOLOGY MCQS AND ANSWERS | EBook
1000 ECONOMICS MCQS FOR EXAMS | EBook
Mughal Empire MCQs | EBook
ECONOMIC GEOGRAPHY MCQs | EBook
350 MCQs ON INDIAN CONSTITUTION | EBook

Question

Suppose that x is initialized as:

	short int x; /*assume x is 16 bits in size*/
	What is maximum number that can be printed using
	printf("%d\n",x);
	
A 127
B 128
C 255
D 32767
Answer & Explanation
Option: [D]

By default short integer is signed. 1 bit is reserveed for sign i.e. only 15 bits are available.

So, the largest number will be:

215+214+..........+upto 20

i.e. 32767

Advertisement
Advertisement

General Knowledge

Month-wise Current Affairs 2022

Category-wise Current Affairs

Jobs by Qualification

Free Mock Test