adplus-dvertising
frame-decoration

Question

For the given set of code select the relevant solution for conversion of data type.
static void Main(string[] args)
 {
     int num1 = 20000;
     int num2 = 50000;
     long total;
     total = num1 + num2;
     Console.WriteLine("Total is : " +total);
     Console.ReadLine();
 }

a.

Compiler will generate runtime error

b.

Conversion is implicit type, no error generation

c.

Specifying datatype for conversion externally will solve the problem

d.

None of the mentioned

Posted under C# programming

Answer: (b).Conversion is implicit type, no error generation

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. For the given set of code select the relevant solution for conversion of data type.