My Report

C# Programming Mock Test 1


Correct Answer: 2 points | Wrong: -1 point
Grades: A* (100% score) | A (80%-99%) | B (60%-80%) | C (40%-60%) | D (0%-40%)
advertisement
 10%

Question 1 of 10

1. What will be the correct set of C# code to display the value of given variable 'c' as '25.302'.

Question 1 of 10

Question 2 of 10

2. The correct way of incrementing the operators are:

Question 2 of 10

Question 3 of 10

3. Choose effective differences between 'Boxing' and 'Unboxing'.

Question 3 of 10

Question 4 of 10

4. 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?

Question 4 of 10

Question 5 of 10

5. Check the following C# code whether the given relation operator works according to the if condition or not.

 static void Main(string[] args)
 {
     int a = 10;
     int b = 5;
     int c = 12; 
     int e = 8;
     int d;
     d = Convert.ToInt32((a * (c - b) / e + (b + c)) <= (e * (c + a) / (b + c) + a));
     Console.WriteLine(d);
     if (d == 1)
     {
         Console.WriteLine("C# is great language!");
         Console.WriteLine((a * (c - b) / e + (b + c)));
     }
     else
     {
         Console.WriteLine("harsh is not great language!");
         Console.WriteLine((e * (c + a) / (b + c) + a));
     }
 }

Question 5 of 10

Question 6 of 10

6. Valid Size of float data type is?

Question 6 of 10

Question 7 of 10

7. Correct statement about strings are?

Question 7 of 10

Question 8 of 10

8. The Default value of Boolean Data Type is?

Question 8 of 10

Question 9 of 10

9. Which of the following format specifiers is used to print hexadecimal values and return value of output as Octal equivalent in C#?

Question 9 of 10

Question 10 of 10

10. Select appropriate difference between decimal, float and double data type in C#?

i) Float and Double are floating binary point types while decimal is a floating decimal point type.
ii) Precision difference for float is '7' digit for double is '15' to '16' digit and for decimal is '28' to '29' digits.
iii) Some values which cannot be exactly represented hence for those values float and double are more appropriate.

Question 10 of 10


 

Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.