Computer Science, asked by saurabhmandal65, 5 months ago

what is the value of a in below program?
int main()
{
int a,b=20;
a = 90/b;
return 0;
}​

Answers

Answered by khalsaJaskirat
2

Answer:

option A is correct 4.5 will be the answer

Explanation:

a=90/20=4.5

Answered by monica789412
1

The value of 'a' from the expression given in the following program will be 4.

How to evaluate:

  • Technically, if we solve the the given problem, then the answer will come as:

             It is mentioned that a=20 and b= 20

             and a=90/b

             a=90/20

           Therefore, a=4.5

  • But, the variable 'a'  stores the value after evaluation of the expression is of integer datatype.
  • The integer datatype don't store the decimal numbers, so in case of integer datatype the decimal part is skipped and the final answer is  only the integer part.

Thus, the value of 'a' becomes 4.

Similar questions