Create 5 Child for Process | Operating system

Create 5 child processes for a process. The processes should be executing in
parallel. The parent process should wait till all the child processes are terminated.

Solution :-
#include<stdio.h>
#include<sys/types.h>
#include<unistd.h>

int main()
{
int i;
for(i=0;i<5;i++)
{
if(fork()==0)
{
printf("n");
printf("I am Child No.:%dn",i+1);
printf("My pid is:%dn",getpid());
printf("My ppid is:%dn",getppid());
printf("My uid is:%dn",getuid());
printf("My gid is:%dn",getgid());
exit(0);
}
}

printf("nI am father...!!!n");
printf("My pid is:%dn",getpid());
printf("My uid is:%dn",getuid());
printf("My gid is:%dn",getgid());

return 0;
}