Computer Science, asked by anirudhreddy25, 5 months ago

float num1;
short num2;
22
Long num3;

What is the data type of num1 - num3/num2?
1​

Answers

Answered by mad210203
4

Float

Explanation:

  • num1 is a variable of float.
  • num2 is a variable of short int.
  • num3 is a variable of long int.
  • The size of float is 4 bytes, size of short int is 2 bytes and the size of long int is 4 or 8 bytes.
  • In (num1 - num3)/num2, before solving it, the data types are type casted.
  • In given variables, highest data type is float. So, all variables are converted into float datatype.
  • So, num1, num2 and num3 will become the float data type.
  • If we subtract float from float (num1 - num3), we get float datatype.
  • Also, if we divide float with float ((num1 - num3)/num2), we get float datatype.

Therefore, the data type of (num1 - num3)/num2 is float.

Similar questions