A C program to display the information about the root and the user

#include<stdio.h>
#include<sys/types.h>
#include<pwd.h>
#include<unistd.h>
#include<stdlib.h>

int main()
{
uid_t uid;
gid_t gid;

struct passwd *pw;
uid = getuid();
gid = getgid();

printf("User is %s\n", getlogin());

printf("User IDs : uid=%d, gid=%d\n", uid,gid);

pw= getpwuid(uid);
printf("UID passwd entry: \n realname=%s,\n name =%s,\n uid=%d,\n gid=%d,\n home=%s,\n shell=%s\n", pw->pw_gecos, pw->pw_name, pw->pw_uid, pw->pw_gid, pw->pw_dir, pw->pw_shell);
pw= getpwnam("root");
printf("root passwd entry:\n");
printf(" realname=%s,\n name=%s,\n uid=%d,\n gid=%d,\n home=%s,\n shell=%s\n", pw->pw_gecos, pw->pw_name, pw->pw_uid, pw->pw_gid, pw->pw_dir,pw->pw_shell);
exit(0);
}