lundi 6 juillet 2015

Constant out of range in comparison C++

I just created a C++ problem from my project, I compiled the program and gives me NO ERRORS but gives me a WARNING and I cannot run or test the program.

#include <iostreamn.h>
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main()
{
    int grossincome,totaldeduction,tax,output;

    cout<<"Input gross income: "<<endl;
    cin>>grossincome;
    cout<<"Input total deductions: "<<endl;
    cin>>totaldeduction;

    if (grossincome > 100000)
    {
       tax = (grossincome * .20);
       output = (grossincome - totaldeduction - tax);
    }
    else if((grossincome <= 100000) && (grossincome >= 50000))
    {
       tax = (grossincome * .15);
       output = (grossincome - totaldeduction - tax);
    }
    else if(grossincome < 50000)
    {
       tax = (grossincome * .10);
       output = (grossincome - totaldeduction - tax);
    }
    cout<<"Output: "<<output;
    system("pause");
    return 0;
}

I get WARNING in all of my If statements saying the message below.

  WARNING message: "Warning Q4.CPP 16: Constant out of range in comparison"
                   "Warning Q4.CPP 21: Constant out of range in comparison"
                   "Warning Q4.CPP 21: Constant out of range in comparison"
                   "Warning Q4.CPP 26: Constant out of range in comparison"

Aucun commentaire:

Enregistrer un commentaire