C# Operators Programming Interview Questions and Answers - 2
Question: 6
Give the advantages of the compound assignment?
Statement is more concise and easier to read.
Use of shorthand operator’s results in a more efficient code.
What appears on the left side need not be repeated and therefore it becomes easier to write.
Question: 7
Classify the operator based on the number of operands?
Unary,
Binary,
Ternary
Question: 8
What is called mixed mode arithmetic?
When one of the operand is real and the other is integer, the expression is called a mixed mode arithmetic expression.
If either operand is of the real type, then the other operand is converted to real and real arithmetic is performed.
Question: 9
Define widening and narrowing?
The process of assigning a smaller type to a larger one is known widening or promotion. The process of assigning a larger type to a smaller one is known as narrowing.
Question: 10
What are the advantages of casting?
It avoids truncation in a division.
Used to round off floating point number to the nearest integer.
Double a= 65.45;
Int b= (int) a//b is 65
Provides methods to convert between numeric values and strings.
Int X = 100;
String S1 = X. ToString (); // integer becomes string
Int y = Int. Parse (S1); // string becomes integer
A.C. Basics and Networks Quiz Questions & Answers Pdf More
Signals and Systems Quiz Questions and Answers Pdf More
Signals and Systems MCQ Questions and Answers Pdf More
Electrical Power Sources Quiz Questions & Answers Pdf More
Electromagnetic Field Theory Question Bank 2024-2025 More
100+ Tally ERP 9 Interview Questions & Answers Pdf More
1000+ General English Questions and Answers 2020-2021 More
1000+ Verbal Ability Questions and Answers 2023 - 2024 Pdf More
100+ Synonyms Questions and Answers for SSC Exam More
Top 100+ Active & Passive Voice Exercises with Answers Pdf More