Data-Type
Question 1 |
In C programming language, if the first and the second operands of operator + are of types int and float, respectively, the result be of type
int | |
float | |
char | |
long int |
Question 1 Explanation:
Expressions don’t have a type. Expressions can result in a value which has a type.
The rules for implicit type casting are as follows:
Integer Promotion: All types below int, like char and short are converted to int.
If still types other than int remain, following rules are executed by order
● If long double exists, all are converted to long double.
● If double exists, all are converted to double.
● If float exists, all are converted to float, and so on.
The rules for implicit type casting are as follows:
Integer Promotion: All types below int, like char and short are converted to int.
If still types other than int remain, following rules are executed by order
● If long double exists, all are converted to long double.
● If double exists, all are converted to double.
● If float exists, all are converted to float, and so on.
Question 2 |
For x and y are variables as declared below
double x=0.005, y=-0.01;
what is the value of ceil(x+y), where is a function to compute ceiling of a number?
1 | |
0 | |
0.005 | |
0.5 |
Question 2 Explanation:
x+y = 0.005-0.01 =-0.005
Description
CEIL(x) rounds the number x up.
Examples
CEIL(1.3) equals 2
CEIL(-1.6) equals -1
Description
CEIL(x) rounds the number x up.
Examples
CEIL(1.3) equals 2
CEIL(-1.6) equals -1
Question 3 |
The quantity of very long word is:
32 bits | |
64 bits | |
128 bits | |
256 bits |
Question 3 Explanation:
A double word is a single unit of data expressing two adjacent words (a word is a standard unit of data for a certain processor architecture). For instance, if a single word is 16-bits in size, a double word would be 32-bits. A double word can doubled a second time, which turns it into a very long word that is 64-bits.
There are 3 questions to complete.
