recategorized by
1,834 views
1 votes
1 votes

How many of the following declarations are correct ?

int $z = 7.0$;

double void = $0.000$;

short array $[2] = {0, 1, 2}$; 

char c = “\n”;

  1. None
  2. One is correct
  3. Two are correct
  4. All four are correct
recategorized by

1 Answer

1 votes
1 votes

answer must be A.

None of them is correct.

 int z=7.0; 
7.0 is not an integer int z=7 is right
	double void = 0.000; 
 void is a keyword 
	short array [2]=0,1,2; 
 short array [2] = {0,1,2} is the right format
	char c = "\n"; 
 -- char c = '\n';  is the right format

Related questions

1 votes
1 votes
2 answers
1
makhdoom ghaya asked Sep 5, 2016
1,745 views
Which one of the following will set the value of $y$ to $5$ if $x$ has the value $3$, but not otherwise ?If $(x = 3) y = 5$ If $x = = 3 (y = 5)$If $(x = = 3); y = 5$ If $...
0 votes
0 votes
2 answers
2
3 votes
3 votes
1 answer
3
makhdoom ghaya asked Sep 11, 2016
2,093 views
One of the distinguished features of super-computer over other category of computer isParallel processingHighest accuracy levelMore speedMore capacity
2 votes
2 votes
2 answers
4
makhdoom ghaya asked Sep 11, 2016
1,562 views
The basic concepts of ethics in information society is/areResponsibilityAccountabilityLiabilityAll of the above