int I=10,j=20,k;
k=(I+j)/3
Evaluate the C++ expressions.
I think answer should be 10.
Answers
Answered by
1
Answer is 10
Evaluation
=> (10+20)/3
=> 30/3
=> 10 (since k is defined as integer)
Answered by
5
Given :
l = 10
j = 20
So
k = ( l + j )
= > k = ( 10 + 20 ) / 3
= > k = 30 / 3
= > k = 10
The datatype of k is int.
Hence k = 10.
If it was double , then k = 10.0
ANSWER :
k = 10
Similar questions