C program to print error code, if directory is already present [system call: mkdir]

C program to print error code, if directory is already present [system call: mkdir]


#include <stdio.h>
#include <string.h>
#include <errno.h>

int main () {
    FILE *fp;

    errno = 0;
    int dir_result = mkdir("neelu", 0755);
    if(dir_result != 0 && errno != EEXIST){
        printf( "Value of errno: %s\n", strerror(errno));
    }
    else if (errno == EEXIST)
    {
        printf("error code: %s", strerror(errno));
    }

    return(0);
}