- AUnsigned short
- B Long
- C Int
- DSigned short
Time Taken:
Correct Answer:
Wrong Answer:
Percentage: %
65000 comes in the range of short (16-bit) which occupies the least memory. Signed short ranges from -32768 to 32767 and hence we should use unsigned short.
char has lesser bytes than int and int has lesser bytes than double in any system
Option C is correct with respect to the size of the datatypes in the C programming language. The char data type typically has a size of 1 byte, the int data type typically has a size of 4 bytes, and the double data type typically has a size of 8 bytes. Therefore, char < int < double in terms of size. However, it's worth noting that the size of these data types can vary depending on the specific implementation and architecture of the system being used.
In C language, data types can be arranged based on their size in bytes. Here's a common arrangement from smallest to largest:
Please note that the actual size of these data types might vary depending on the compiler and system architecture.
Output:
98.000000
Since the ASCII value of b is 98, the same is assigned to the float variable and printed.
This code is a C language program that includes the standard input/output library and defines the main function.
Within the main function, there is a declaration of a float variable x which is assigned the ASCII value of character 'b'.
The printf statement is then used to print the value of the x variable as a floating-point number using the %f format specifier.
Since the ASCII value of 'b' is 98, the output of the program will be 98.000000.
Finally, the main function returns an integer value of 0 to signify that the program has executed successfully.
Output on Turbo C++ 3.0:
8 4 2
Output on Turbo C++ 4.5:
8 4 2
Output on Linux GCC:
8 4 4
Output on Visual C++:
8 4 4
By default data type of numeric constants is:
6.5 : double
90000: long int
'A': char
In C size of data type varies from compiler to compiler.
Output of Turbo C++ 3.0: 10 65526 0 0
10 65526 0 0
Turbo C ++4.5: 10 65526 0 0
10 65526 0 0
Linux GCC: 10 4294967286 0 0
10 4294967286 0 0
Visual C++: 10 4294967286 0 0
10 4294967286 0 0
a=(signed)10u;
signed value of 10u is +10
so, a=10
b=(unsigned)-10;
unsigned value of -10 is :
MAX_VALUE_OF_UNSIGNED_INT – 10 + 1
In turbo c 3.0 complier max value of unsigned int is 65535
So, b = 65526
y = (signed)10u + (unsigned)-10;
= 10 + 65526 = 65536 = 0 (Since 65536 is beyond the range of unsigned int. zero is its corresponding cyclic vlaue)
X = y = 0
False is the correct default value of a Boolean type.
The default value of a boolean variable in Java:
In Java, if you declare a boolean instance variable (not local variable) and do not initialize it, its default value is false. ✅
False and True (capitalized) are not valid in Java.
0 is an integer, not boolean.
Answer: false
We cannot predict the value of volatile variable because its value can be changed by any microprocessor interrupt.
Char is NOT an Integer.