Computer Science, asked by mriduls3189, 1 year ago

How to add two variables irrespective of datatypes?

Answers

Answered by hiramani7080
0
let the two variables be "a" and "b"
Then,
sum=a+b

hiramani7080: if you have any problem then be free to ask me
Answered by SohamKundu012
0

Answer:

(datatype of c)c = (datatype of a)a + (datatype of b)b

Explanation:

Datatypes are used to determine the nature of the variable .

When we specify that a variable has a certain datatype we say what values the expression may have .

The datatypes are :

  • Byte .
  • Short .
  • Char .
  • Int .
  • Float .
  • Long .
  • Double .
  • Boolean .
  • String .
Similar questions