<p>How does the compiler know the prototype of sleep function or even printf function, when I did not include any header file in the first place?</p>

<p>Moreover, if I specify <code>sleep(1,1,"xyz")</code> or any arbitrary number of arguments, the compiler still compiles it.
But the strange thing is that gcc is able to find the definition of this function at link time, I don't understand how is this possible, because actual <code>sleep()</code> function takes a single argument only, but our program mentioned three arguments.</p>

<pre><code>/********************************/
int main()
{
 short int i;
 for(i = 0; i&lt;5; i++)
 {
    printf("%d",i);`print("code sample");`
    sleep(1);
 }
 return 0;
}
</code></pre>

C will guess int for unknown types.  So, it probably thinks sleep has this prototype:
```
```
int sleep(int);
```
```
As for giving multiple parameters and linking...I'm not sure.  That does surprise me.  If that really worked, then what happened at run-time?