Identify Datatype.

Q7. Given the following set of identifiers:

byte b;

char ch;

short sh;

int intval;

long longval;

float fl;

Identify the datatype of the following expressions:

a.)’a’-3     

b.) intval * longval – ch  

c.) fl + longval / sh

Ans.

a.) int because

b.) long because

c.) float because

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s