why double is giving wrong output

Revision en1, by saurabhkumarfx, 2020-05-28 21:55:35

int main() { int t; cin>>t; int a,b,c; cin>>a>>b>>c; double tmp=a+b; tmp=tmp/2; cout<<tmp<<"!"; } input is : 1 232444 123233 232434 why it is giving wrong answer:177838; why it is rounding off the value .

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English saurabhkumarfx 2020-05-28 21:56:34 22
en1 English saurabhkumarfx 2020-05-28 21:55:35 290 Initial revision (published)