I'm writing this program and it works, however it asks me to type inputs in the wrong places... here is the code
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main()
{
char name[100];
int height,weight,comparison;
printf("Please enter the name of the criminal.\nEnter end to terminate the program.\n");
scanf("%99s",&name);
//printf("test\n");
comparison = strcmp(name,"end");
while(comparison!=0)
{
printf("\nPlease enter the height(in cm) of the criminal. ");
scanf("%i",&height);
printf("\nPlease enter the weight(in kg) of the criminal. ");
scanf("%i",&weight);
if(height < 165 && weight > 90)
{
printf("%s is a suspect.\n", name);
}
else
{
if(height > 190 && weight < 65)
{
printf("%s is a suspect.\n", name);
}
else
{
printf("%s is not a suspect.\n", name);
}
}
printf("\nPlease enter the name of the criminal.\nEnter end to terminate the program.\n");
scanf("%99s",&name);
comparison = strcmp(name,"end");
}
//printf("the name is %s\n", name);
system("pause");
return 0;
}
and here is a screenshot of the cmd copiled
Please Help..