CSE MCQs :: C-MCQs
- What is the return-type of the function sqrt()
- Which of the following function declaration is illegal?
-
What will be the data type returned for the following function?
int func()
{
return (double)(char)5.0;
} -
What is the problem in the following declarations?
int func(int);
double func(int);
int func(float); -
The output of the code below is
void main()
{int k = m();
printf("%d", k);
}void m()
{printf("hello");
} -
The output of the code below is
int *m();
void main()
{
int *k = m();
printf("hello ");
printf("%d", k[0]);
}
int *m()
{
int a[2] = {5, 8};
return a;
} -
The output of the code below is
int *m();
void main()
{
int k = m();
printf("%d", k);
}
int *m()
{
int a[2] = {5, 8};
return a;
} -
The output of the code below is
void m(int k)
{
printf("hi");
}
void m(double k)
{
printf("hello");
}
void main()
{
m(3);
} - What is the default return type if it is not specified in function definition?
-
What is the output of this C code?
int foo();
int main()
{
int i = foo();
}
foo()
{
printf("2 ");
return 2;
}