So I'm new to c and I'm running into an issue where my if statement is being completely ignored. I want the program to accept two float values that are equal to or larger than 10 and exit with an error message if it does not meet these requirements.
It seems that whatever numbers I enter, the program always rejects the if statement and accepts the else statement. What am I doing wrong?
#include <stdio.h>
#include <stdlib.h>
int main()
{
float first;
float second;
printf("Enter a number \n");
scanf("%f", first);
printf("Enter another number \n");
scanf("%f", second);
if((first >= 10) && (second >= 10)){
printf("thanks");
}else{
printf("enter a larger number");
}
return 0;
}
Aucun commentaire:
Enregistrer un commentaire