我在编译以下程序时遇到非法使用浮点错误。请让我知道我在哪里犯了错误。
#include<stdio.h>
#include<conio.h>
void main()
{
float a;
clrscr();
printf("\n Enter the num : ");
scanf("%f", &a);
if ( a >= 0 )
{
if ( (a % 2) == 0 ) //ERROR HERE
{
printf("\n You entered a positive even num");
}
else
{
printf("\n You entered a positive odd num");
}
}
else
{
if ( (a % 2) == 0 ) //ERROR HERE
{
printf("\n You entered a negative even num");
}
else
{
printf("\n You entered a negative odd num");
}
}
getch();
}