Linux Startup and Shutdown Question: Download Linux Shutdown & Startup PDF

What is the output of this program?

#include<stdio.h>
#include<stdlib.h>

int main()
{
int *ptr1;
while(1){
ptr1 = malloc(1024*1024);
if(ptr1 == 0)
break;
sleep(1);
printf("googlen");
free(ptr1);
}
return 0;
}
a) it will print "google" until the process has been stopeed by any signal
b) it will print nothing
c) segmentation fault
d) none of the mentioned

Tweet Share WhatsApp