Cannot implicitly convert type ‘int’ to ‘string’ C# class

Try like this

AdditionTotal = (num1 + num2).ToString(); 

num1 and num2 both is an int and their sum is also an int

C# can’t convert it directly from int to string .

you have to cast it pragmatically in order to assign.

Leave a Comment