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
Submitted by: Murtazaa) it will print "google" until the process has been stopeed by any signal
Explanation:
None.
Output:
[root@localhost google]# gcc -o san san.c
[root@localhost google]# ./san
google
google
google
google
google
^Z
[10]+ Stopped ./san
[root@localhost google]#
Submitted by: Murtaza
Explanation:
None.
Output:
[root@localhost google]# gcc -o san san.c
[root@localhost google]# ./san
^Z
[10]+ Stopped ./san
[root@localhost google]#
Submitted by: Murtaza
Read Online Linux Startup and Shutdown Job Interview Questions And Answers
Top Linux Startup and Shutdown Questions
☺ | At the end of kernel bootstrap, which process is started? |
☺ | Single user mode shell runs as: |
☺ | Which is the only partition mounted in Single user mode? |
☺ | Which of the following is not a valid run-level? |
☺ | The shell used for Single user mode shell is: |
Top Linux OS Categories
☺ | Device Drivers Interview Questions. |
☺ | Linux OS Management Interview Questions. |
☺ | Linux Makefile Interview Questions. |
☺ | Linux Environment Interview Questions. |
☺ | Linux OS Shell Interview Questions. |