which error is it - a semantic error or a link error? I am having a simple doubt in C programming language. 

In any simple C code snippet, if by mistake suppose i have written intmain() instead of main().

Then it represents what type of error ?



It will not be a lexical error as compiler will correctly make a token for it and it is also not a syntax error clearly. 

I think it is a semantic error as in this phase compiler checks with the meaningful statements, scoping, binding, variable not declared, function not declared, any variable declared twice, etc. 



But, on the other hand, I also think it as a linker error as in the semantic phase, it can throw a error that function intmain() is not declared and it is been directly used.



Can anyone make this crystal clear that what is the actual error ?
We can reproduce your error using this C++ code:

intmain() {
    return 0;
}


The following error is returned during compile time:

error: ISO C++ forbids declaration of ‘intmain’ with no type [-fpermissive]


Every function in C/C++ has to have a type. In this sense, it's a type error, which falls in the category of (static) semantic errors. On the other hand, your error is caused by a typo. This sort of error is considered a lexical error, which falls under syntax errors.

There is a lot of discussion whether certain errors are syntactical or static semantic. My opinion is this case is that the error is lexical, considering the cause.