CrazyEngineers Archive
Old, but evergreen and popular discussions on CrazyEngineers, presented to you in read-only mode.
@rengaraj • 04 Dec, 2009
Sir / madam,
My question is

What is the minimum value of char type. Select the one correct answer.
a. 0
b. -215
c. -28
d. -215-1

Advance Thanks,
R.Rengaraj
{Java Certification Quiz}
{On this forum my 19th Question.}
@Mahesh Dahale • 04 Dec, 2009 What is the minimum value of char type. Select the one correct answer.
a. 0
b. -215
c. -28
d. -215-1

char: The char data type is a single 16-bit Unicode character. It has a minimum value of '\u0000' (or 0) and a maximum value of '\uffff' (or 65,535 inclusive).
@sarveshgupta • 05 Dec, 2009 @Mahesh: char type can also be 8-bit character for C/C++

In Java we have it to be 16 -bit I suppose

Although it will have a minimum value of 0 for both the cases as you have told.

Am I correct?
@rengaraj • 05 Dec, 2009 Sir,
Thanks for your reply.
R.Rengaraj
@pradeep_agrawal • 09 Dec, 2009 In C a variable of type char can also hold a -ve value and the range is from -128 to 127. So the min. value taht a char variable can have in C is -128.

If someone want that char variable hold only positive values in C then he/she need to use "unsigned char" instead of "char" while declaring the variable.

-Pradeep
@sarveshgupta • 09 Dec, 2009 Mr Rengaraj has to confirm the right answer for the question..May be you are right Pradeep
@rengaraj • 09 Dec, 2009 Dear Mahesh,
You quoted 0 to be the answer.
But it is for unsigned char . not for char.

mahesh_dahale
What is the minimum value of char type. Select the one correct answer.
a. 0
b. -215
c. -28
d. -215-1
R.Rengaraj
@rengaraj • 09 Dec, 2009 Dear Pradeep,
You are right, Unsigned Char has a min. value of 0.
While,
Char has a min value of -128.
Excellent discussion.
Thanks to all of you.

pradeep_agrawal
In C a variable of type char can also hold a -ve value and the range is from -128 to 127. So the min. value taht a char variable can have in C is -128.

If someone want that char variable hold only positive values in C then he/she need to use "unsigned char" instead of "char" while declaring the variable.

-Pradeep
R.Rengaraj
4.3k views

Related Posts

@MeenakshiMadhura · Dec 5, 2015

Once a request is placed, our app runs algorithms to match potential donors based on location and blood group and notifies only them. Can anyone suggest me some titles for...
7.9k views

@Satya Swaroop Dash · Jan 10, 2014

Nokia has rolled out the new Lumia Black software update for Lumia range of Windows Phone 8 smartphones. The update is now available for download only for the Lumia 925...
4.2k views

@Kaustubh Katdare · Jul 1, 2013

India's first fast breeder reactor (PFBR) at Kalpakkam in Tamil Nadu is the first ever commercial fast breeder nuclear reactor currently under its final stages of construction. The Hindu reports...
4.8k views

@Vatsala · Sep 18, 2007

well...i want to do a mini-project in da field of instrumentation and control(prefferably)...culd neone...suggest me hw do i select a topic n strt up?????
15.9k views

@Kaustubh Katdare · Apr 16, 2011

Canon Rock is the 'Rock' version of popular composition 'Canon In D' by musician John Pachelbel, created by popular guitarist Jerry C. YouTube user 'FunTwo' casually played the song and...
3.1k views