⟩ By default if any regular file is created, the number of link is displayed as 1? a) True b) False
a) True
a) True
Bootstrapping is also known as a) Quick boot b) Cold boot c) Hot boot d) Fast boot
At the end of kernel bootstrap, which process is started? a) /etc/init b) /etc/sched c) /etc/swap d) /etc/kernel
The process of starting up a computer is known as a) Boot Loading b) Boot Record c) Boot Strapping d) Booting
In this program the allocated memory block can store
<pre lang="c" line="1" cssfile="hk1_style">
#include<stdio.h>
#include<stdlib.h>
int main()
{
int *ptr;
ptr = malloc(10);
return 0;
}
a) int
b) char
c) float
d) all of the mentionedPlease tell me output of this program?
#include<stdio.h>
#include<stdlib.h>
int main()
{
int *ptr;
ptr = (int *)calloc(1,sizeof(int));
if (ptr != 0)
printf("%dn",*ptr);
return 0;
}
a) 0
b) -1
c) garbage value
d) none of the mentionedProgram given below will allocate the memory of ___ bytes for pointer "ptr".
#include<stdio.h>
#include<stdlib.h>
int main()
{
int *ptr;
ptr = (int*)malloc(sizeof(int)*4);
ptr = realloc(ptr,sizeof(int)*2);
return 0;
}
a) 2
b) 4
c) 8
d) none of the mentionedIn which condition this prgram will print the string "google"?
#include<stdio.h>
#include<stdlib.h>
int main()
{
int *ptr;
ptr = (int *)malloc(sizeof(int)*10);
if (ptr == NULL)
printf("googlen");
return 0;
}
a) if the memory could not be allocated to the pointer "ptr"
b) if the memory has been allocated to the pointer "ptr" successfully
c) it will never print
d) none of the mentionedWhat is the output of this program?
#include<stdio.h>
#include<stdlib.h>
int main()
{
int ret;
int *ptr;
ptr = (int *)malloc(sizeof(int)*10);
free(ptr);
free(ptr);
return 0;
}
a) it will print nothing
b) it will give segmentaion fault
c) undefined behaviour
d) none of the mentionedWhat 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 mentionedWhat is the output of this program?
#include<stdio.h>
#include<stdlib.h>
int main()
{
int *ptr1, *ptr2;
ptr1 = malloc(4);
*ptr1 = 10;
*ptr2 = free(ptr1);
printf("%dn",*ptr2);
return 0;
}
a) 10
b) it will print the address stored in ptr1
c) it will print the address stored in ptr2
d) it will give an error