what I'm trying to do is see if a year is bissextile or not, but when I'm using a boolean function it gives me this strange message.
here is my code:
#include<stdio.h>
#include<stdbool.h>
main(){
int n1;
printf("what is the year?\n");
scanf("%d",&n1);
if(itIS(n1)){
printf("the year %d is bissextile\n",n1);
}else{
printf("the year %d is not bissextile\n",n1);
}
}
bool itIS(int n1){
bool is = false;
if((n1/400)== 0){
is = true;
}
return is;
}
and this is the thing that appears to me:
exe1.c:144:6: error: conflicting types for ‘itIS’ bool itIS(int n1){
^
exe1.c:134:6: note: previous implicit declaration of ‘itIS’ was here if(itIS(n1)==true){
^
I don't understand what's the problem. Although if I do this without the boolean function it works perfectly.
Edit: So i already know what's the problem thanks to @Bill Lynch. The problem is i need to write the boolean function before the main function, so the compiler sees the function, basically that's it.