Can someone help me with this

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ghalan
    New Member
    • Jan 2010
    • 1

    Can someone help me with this

    I need this for school and can't make it work
    _______________ _______________ _______________ _______________ ______

    #include<iostre am.h>
    int a,b,c;
    int main()
    {
    cin>>a>>b>>c;
    if((a+b)/2=c)
    cout<<"corect";
    else
    if((a+c)/2=b)
    cout<<"corect";
    else
    if((c+b)/2=a)
    cout<<"corect";
    else
    cout<<"incorect ";
    return 0;
    }

    _______________ _______________ _______________ _______________ ______
    a.cpp: In function `int main()':
    a.cpp:6: error: non-lvalue in assignment
    a.cpp:9: error: non-lvalue in assignment
    a.cpp:12: error: non-lvalue in assignment


    Can somebody help me please
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    In all your if statements you have =; assignment, instead of ==; comparison.

    Comment

    Working...