toLower - Tests character and converts to lowercase if uppercase in C

#include<stdio.h>
#include<ctype.h>
int main()
{
    int counter=0;
    char mychar;
    char str[]="TeSt THis a SamPLe seNTeNce.\n";

    while (str[counter])
    {
        mychar=str[counter];
        putchar (tolower(mychar));
        counter  ;
    }
    return 0;
}