Check The Programming Section
How many characters can stroe by a character variable
128 characters
20 characters
one character
two character
Answer: The size of character data type is 1 byte and each charcters requires 1 byte of memory to store into a memory block. It means a character variable can store maximum one character only.
A variable name can not start with
a digit
underscore
an alphabet
None of the above
Answer: A variable name always started with an alphabet and it can be an underscore as a special symbol. But, it can not be a digit. read more.....
1 byte information is equal to
4 bits
8 bits
12 bits
16 bits
Answer: 8 bits.
A short integer variable occupies a memory block of size in 32 bits system
1 byte
2 byte
4 byte
8 byte
Answer: A short integer always takes half of the memory requirements of an int data type. In 32 bit system, an integer takes 4 bytes memory block. So the memory requirement for a short integer is 2 byte. read more......
The default modifier for int data type is
unsigned
signed
const
volatile
Answer: In C, int data type can have any of the 4 modifiers, which can change the meaning of a data type. By default, an integer data type is considered as signed int and can have a positive or a negative value. read more.....
The C keywords are reserved words by
an interpreter
a compiler
a linker
a header file
Answer: keywords are reserved by compiler and their meaning is defined in the compiler. read more.....
What is true about a const variable
initialization is not required
it can be updated
must be initialized at the time of declaration
can be updated by another program
Answer: The const qualifier is used to declare a variable as constnat. A const variable must be initialized at the time of declaration and further can not be modified. read more......
What is the purpose of semi-colon (;)
it is used to specify start of a statement
it is used to specify strat of a block
it tells the compiler about the end of a statement
it is used as separator between two variable declaration
Answer: Semi-colon (;) is a special character and used to tell the compiler about the end of a statement in C/C++. read more......
An unsigned varibale contains a value
less than zero
greater or equal to zero
only zero
any number as positive or negative
Answer: An unsigned value always represent a number without a plus ('+') or minus ('-') symbol. So number which is equal or greater than zero (0) does not require a sign to represent that number. read more.....
What is the purpose of character U as suffix with a constant value
it tells the compiler the constant is undefined
the constant value will be underflow
it qualifies a constant value as unsigned positive value
it qualifies a constant value as user-defined
Answer: Like U, character like L and F can also be used as suffix with a constant value. If any constant value 23 is prefixes with U, it represents a unsigned positive constant value. read more.....
What is the correct range of character data type is
0 - 255
-128 - 127
-127 - 128
0 - 256
Answer: The size of character data type is 1 byte equal to 8 bits. So the maximum value that a character can have 2^8 - 1 = 255. Because range of values started from 0. But a character data type can have a positive and negative values with signed modifier. So the ranges of values will equally divided to positive and negative values as range of -128 to 127.
In C every variable has a
name
type
value
size
All of the above
Answer: a variable has a name to represent a memory block of RAM and a variable has a value and a value must be of a type. The every memory block will have some pre-defined size, based on the data type. The answer will be all of the above. read more......
The double floating-point supports maximum decimal points upto
6th
8th
10th
12th
Answer: The double floating-point supports upto 10th decimal place.
In C/C++ a program execution is started from
any part of the progarm
from a user defined function
from main method
from #include
Answer: All C/C++ program must have a global function main( ), which is designated to start the execution of the program. The main method gets called by the operating system. read more....
How many keywords are there in ANSI C?
16
32
30
42
Answer: In ANSI C number of reserved words (keywords) are 32. read more......
Which of the following statement is wrong?
int a = b = c = d = 4;
int a = 2.4;
int a = 'A' * 23;
int a = 'A' + 10;
Answer: Except the first statement all other statements are valid variable declaration and initialization statement. Multiple assignment during variable declaration (int a = b = c = d = 4;) is not accepted by the compiler.
In C/C++, statements follwoing main() are enclosed within
[ ]
( )
{ }
< >
Answer: main is global function and according to the function defination, a function also has a body contains one or more statements. In C/C++, all types of function body are represented with a set of curly blocks { }. read more.....
How to assign a hexa-decimal number to an integer variable
0 is prefixed with the constant value
0x is prefixed with the constant value
hex is prefixed with the constant value
dec is prefixed with the constant value
Answer: In C/C++, an integer constant value can be a decimal, octal or hexa-decimal. To make a integer constant as hexa-decimal, we need to prefix 0x with the value. Such as 0x23, 0x42 are the some examples of hexa-decimal number.
How to assign a octal number to an integer variable
0 is prefixed with the constant value
0x is prefixed with the constant value
hex is prefixed with the constant value
dec is prefixed with the constant value
Answer: In C/C++, an integer constant value can be a decimal, octal or hexa-decimal. To make a integer constant as octal, we need to prefix 0 with a decimal constant value. Such as 023, 042 are the some examples of octal number.
What is the significance of e in a real-valued constant
it represents the exponential form of a real value
it represents the fractional form of a real value
it represents a double floating-point constant value
it represnts a long double floating-point constant value
Answer: A real constnat value can be of two types as fractional or exponential type. The character e represents an exponential form of real-valued constnat. read more......