adplus-dvertising

Welcome to the Data Types,Variables and Operators MCQs Page

Dive deep into the fascinating world of Data Types,Variables and Operators with our comprehensive set of Multiple-Choice Questions (MCQs). This page is dedicated to exploring the fundamental concepts and intricacies of Data Types,Variables and Operators, a crucial aspect of C# programming. In this section, you will encounter a diverse range of MCQs that cover various aspects of Data Types,Variables and Operators, from the basic principles to advanced topics. Each question is thoughtfully crafted to challenge your knowledge and deepen your understanding of this critical subcategory within C# programming.

frame-decoration

Check out the MCQs below to embark on an enriching journey through Data Types,Variables and Operators. Test your knowledge, expand your horizons, and solidify your grasp on this vital area of C# programming.

Note: Each MCQ comes with multiple answer choices. Select the most appropriate option and test your understanding of Data Types,Variables and Operators. You can click on an option to test your knowledge before viewing the solution for a MCQ. Happy learning!

Data Types,Variables and Operators MCQs | Page 6 of 14

Q51.
Number of digits upto which precision value of float datatype is valid ?
Discuss
Answer: (d).Upto 7 digit
Q52.
Valid Size of float datatype is ?
Discuss
Answer: (c).4 Bytes
Q53.
Correct way to define a value 6.28 in a variable ‘pi’ where value cannot be modified ?
Discuss
Answer: (c).const float pi = 6.28F
Q54.
Select correct set of code to display the value of given variable ‘c’ as ‘25.302’.
a) float a = (double) 12.502f;
   float b = 12.80f;
   float c;
   c = (float) a + b;
   Console.Writeline(c);
   Console.ReadLine();
b) float a = 12.502D;
   float b = 12.80f;
   float c;
   c = a + b;
   Console.WriteLine(c);
   Console.ReadLine();
c) double a = 12.502;
   float b = 12.802f;
   float c;
   c = (float)a + b;
   Console.WriteLine(c);
   Console.ReadLine();
d) double a = (float) 12.502f;
   float  b = 12.80f;
   float  c;
   c = a + b;
   Console.WriteLine(c);
   Console.ReadLine();

a.

a

b.

b

c.

c

d.

d

Discuss
Answer: (c).c
Q55.
Minimum and Maximum range of values supported by ‘float’ data type are ?
Discuss
Answer: (c).1.5 * 10^-45 to 3.4 * 10^38
Q56.
Select appropriate difference between decimal, float and double data type in C# ?

1) Float and Double are floating binary point types while decimal is a floating decimal point type.
2) Precision difference for float is ‘7’ digit for double is ’15’ to ’16’ digit and for decimal is ’28’ to ’29’ digits.
3) Some values which cannot be exactly represented hence for those values float and double are more appropriate.
Discuss
Answer: (c).1, 2, 3
Q57.
Why does a float variable stop incrementing at number ‘16777216’ in given code in C#?
float a = 0 ;
 while (true)
 {
     a++;
     if (a > 16777216)
     break;
 }
Discuss
Answer: (b).Mantissa is different for ‘16777216’ and ‘16777217’
Q58.
Select the output of the following set of code ?
static void Main(string[] args)
{
    int x = 1;
    float y = 2. 4f;
    short z = 1;
    Console. WriteLine((float) x + y * z - (x + = (short) y) );
    Console. ReadLine();
}
Discuss
Answer: (d).0.4000001
Q59.
A float occupies 4 bytes. If the hexadecimal equivalent of these 4 bytes are A, B, C and D, then when this float is stored in memory in which of the following order do these bytes gets stored ?
Discuss
Answer: (d).Depends on big endian or little endian architecture
Q60.
The Default value of Boolean DataType is ?
Discuss
Answer: (c).False
Page 6 of 14

Suggested Topics

Are you eager to expand your knowledge beyond C# programming? We've curated a selection of related categories that you might find intriguing.

Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!