No Results in C++

  c++

Hello i have this problem concerning to calculate BMI using weight , height and gender
and I suppose the char initialization of char is the problem;The problem is I don’t get any results:

#include <iostream>
#include <stdlib.h>
using namespace std;

void IMC(float P, float T,char *Gender)
{
    cout<<"Enter Weight(Kg)"<<endl;
    cin>>P;
    cout<<"Enter Height(m)"<<endl;
    cin>>T;
    cout<<"Enter Gender(F/M)"<<endl;
    cin>>Gender;
    float IMC = P/(T*T);
if(P>2 && P<450 && T>0.5 && T<2.8 && Gender == "F")
{
        if(IMC<=19 )
        { 
        cout<<"Maigreur"<<endl;
        }
        else if(IMC>=19 && IMC<=24 )
        {
        cout<<"Poids normal"<<endl; 
        }
        else if(IMC>=24 && IMC<=30)
        {
        cout<<"Surcharge ponderale"<<endl;  
        }
        else if(IMC>=30 && IMC<=40 )
        {
        cout<<"Adiposite"<<endl;
        }
        else if(IMC>=40 )
        {
        cout<<"Obesite"<<endl;
        }
}
}
int main()
{
float P,T;
char *gender;
IMC(P,T,gender);
}

Source: Windows Questions C++

LEAVE A COMMENT