UGC NET CS 2010 Dec-Paper-2
October 11, 2023UGC NET CS 2010 Dec-Paper-2
October 11, 2023UGC NET CS 2010 Dec-Paper-2
Question 11 |
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”;
int z = 7.0;
double void = 0.000;
short array [2] = {0, 1, 2};
char c = “\n”;
None | |
One is correct | |
Two are correct | |
All four are correct |
Question 11 Explanation:
int z = 7.0; → Incorrect. Given data type is integer but given floating point number.
It is wrong declaration.
double void = 0.000; → Incorrect. void is a keyword but can’t use with variable declaration.
It always return null value.
short array [2] = {0, 1, 2}; → Correct. It is right format. We can declare static values here itself.
char c = “\n”; → Incorrect. It is character data type but given in double quotes. It should be single quote instead of double quote.
It is wrong declaration.
double void = 0.000; → Incorrect. void is a keyword but can’t use with variable declaration.
It always return null value.
short array [2] = {0, 1, 2}; → Correct. It is right format. We can declare static values here itself.
char c = “\n”; → Incorrect. It is character data type but given in double quotes. It should be single quote instead of double quote.
Correct Answer: A
Question 11 Explanation:
int z = 7.0; → Incorrect. Given data type is integer but given floating point number.
It is wrong declaration.
double void = 0.000; → Incorrect. void is a keyword but can’t use with variable declaration.
It always return null value.
short array [2] = {0, 1, 2}; → Correct. It is right format. We can declare static values here itself.
char c = “\n”; → Incorrect. It is character data type but given in double quotes. It should be single quote instead of double quote.
It is wrong declaration.
double void = 0.000; → Incorrect. void is a keyword but can’t use with variable declaration.
It always return null value.
short array [2] = {0, 1, 2}; → Correct. It is right format. We can declare static values here itself.
char c = “\n”; → Incorrect. It is character data type but given in double quotes. It should be single quote instead of double quote.
Subscribe
Login
0 Comments