Linux Startup and Shutdown Question:
Download Questions PDF

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 mentioned

Answer:

d) all of the mentioned
Explanation:
When the malloc() is used without typecasting the default type is void*.

Download Linux Shutdown & Startup Interview Questions And Answers PDF

Previous QuestionNext Question
The process of starting up a computer is known as:
a) Boot Loading
b) Boot Record
c) Boot Strapping
d) Booting
Please 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 mentioned