int main(int argc, char** argv) { int i = 0; while (i < 2) { fork(); system(\"ps -o pid,ppid,comm,stat\"); i++; } return (EX
I believe the answer is 6.
in the first iteration, fork() is called, splitting the process in 2, thus calling ps twice.
fork()
in the second iteration, fork is called again in each process, so you now have 4 processes running ps.
total calls to ps: 2+4=6.