#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
void main()
{
pid_t pid1,pid2;
char ch1,ch2,ch3;
pid1=fork();
ch1='b';
ch2='c';
ch3='a';
if(pid1<0){
fprintf(stderr,"Fork 1 Failed");
exit(-1);
}
else if (pid1==0){
printf( "%c\n",ch1 );
}
else{
wait(NULL);
printf( "%c\n",ch3);
exit(0);
}
pid2=fork();
if(pid2<0){
fprintf(stderr,"Fork 2");
exit(-1);
}
else if (pid2==0){
printf( "%c\n",ch2 );
}
else{
wait(NULL);
printf( "%c\n",ch3);
exit(0);
}
}