why double is giving wrong output

Правка en2, от saurabhkumarfx, 2020-05-28 21:56:34
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 .

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский saurabhkumarfx 2020-05-28 21:56:34 22
en1 Английский saurabhkumarfx 2020-05-28 21:55:35 290 Initial revision (published)