Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

where are my errors

$
0
0
#include <stdio.h>
#include <stdlib.h>
#include <math.h>




int main()
{
        int age, weight, height, meters, inches, feet, BMI;
		char Height, ch;
  
        printf("Please enter your age: ");
        scanf("%d", &age);
        
        printf("Please enter your weight in kg: ");
        scanf("%d", &weight);
        
        printf("Would you like to enter your height in meters or inches or feet?: ");
        scanf("%c", &Height);
        
        if (Height = inches)
        	printf("height in inches: ");
        	scanf("%d", &inches);
        	inches=inches*0.0254;
        	inches=meters;
        	
        if  ((Height = feet))
			printf("height in feet: ");
			scanf("%d", &feet);
			feet=feet*0.3048;
			feet=meters;
			
		if  ((Height = meters))
			printf("height in meters: ");
			scanf("%d", &meters);
			meters=meters;
					
		meters=inches*0.0254;
		meters=feet*0.3048;
		
  		BMI= weight/height*2;

        if (BMI< 18.50)
        {
                printf("you are underweight");
        }
        else if ((BMI< 16.00))
        {
                printf("severe thinness\n");
        }
         else if ((BMI <16.99) && (BMI > 16.00))
		 {
            printf("moderate thinness\n");
 		}
      
      	else if ((BMI < 18.49) && (BMI > 17.00))
      	{
            printf("Mild thinness\n");
 		}
      
      	if ((BMI < 24.99) && (BMI > 18.50))
      	{
            printf("You are in normal range\n");
 		}
    
      	if (BMI >= 25.00)
      	{
            printf("You are overweight\n");
 		}
      	else if ((BMI < 29.99) && (BMI > 25.00))
       	{
            printf("You are pre-obese\n");
 		}
      	if (BMI >= 30.00)
      	{
            printf("You are  obese\n");
 		}
      
      	else if ((BMI <=34.99) && (BMI > 30.00))
      	{
            printf("You are obese in class I\n");
 		}
      
      	else if ((BMI < 39.99) && (BMI > 35.00))
      	{
            printf("You are obese in class II\n");
 		}
      	if (BMI >= 40.00)
      	{
            printf("You are obese in class III\n");
 		}
        
        
        printf("\n\n");              
        system("PAUSE");	
        return 0;
}

Viewing all articles
Browse latest Browse all 51036

Trending Articles