Hi, I am fairly new to C and have been teaching myself the language for now in prep. for the class I am taking in the Fall. I have been writing a prgram for my girlfriend and have encountered a problem. What happens is that I enter the two values for the variables, but the program never enters the if statements. Can anyone please help me, I have tried many things and have looked online but cannot find the solution. Thank you!
The problem that I believe is happening is bolded.
Code:
#include <stdio.h>
main()
{
char Entery_One[3];
char Entery_Two[3];
float pounds;
float ounces;
float grams;
char x;
printf("Please enter what you want to convert from. Ie lb\n");
scanf("%s", Entery_One);
printf("Please enter what you want to convert to. Ie oz\n");
scanf("%s", Entery_Two);
printf("\n%s\n",Entery_One); //TEST
printf("%s",Entery_Two); //TEST
if(Entery_One == 'lb') {
printf("Enter how many pounds you would like to convert\n");
scanf("%f", £s);
if(Entery_Two == 'oz')
{
pounds2ounces(pounds);
}
}