#include #include int main() { fork(); fork() && fork() || fork(); fork(); printf
Save the file, say as fork-count.c. Then compile it with gcc fork-count.c -o fork-count. Then you can run it and count the number of lines of output with ./fork-count | wc -l.
fork-count.c
gcc fork-count.c -o fork-count
./fork-count | wc -l