1. What will be the output of the following C code?
#include <stdio.h>
static int x = 5;
void main()
{
x = 9;
{
int x = 4;
}
printf("%d", x);
}
#include <stdio.h>
static int x = 5;
void main()
{
x = 9;
{
int x = 4;
}
printf("%d", x);
}
2. What will be the output of the following C code?
#include <stdio.h>
void m(int k)
{
printf("hi");
}
void m(double k)
{
printf("hello");
}
void main()
{
m(3);
}
#include <stdio.h>
void m(int k)
{
printf("hi");
}
void m(double k)
{
printf("hello");
}
void main()
{
m(3);
}
3. Automatic variables are allocated memory in . . . . . . . .
4. What will be the output of the following C code?
#include <stdio.h>
void f();
int main()
{
#define max 10
f();
return 0;
}
void f()
{
printf("%d\n", max * 10);
}
#include <stdio.h>
void f();
int main()
{
#define max 10
f();
return 0;
}
void f()
{
printf("%d\n", max * 10);
}
5. Which of the following is true for the static variable?
6. What will be the data type returned for the following C function?
#include <stdio.h>
int func()
{
return (double)(char)5.0;
}
#include <stdio.h>
int func()
{
return (double)(char)5.0;
}
7. What will be the output of the following C code?
#include <stdio.h>
void main()
{
static int x = 3;
x++;
if (x <= 5)
{
printf("hi");
main();
}
}
#include <stdio.h>
void main()
{
static int x = 3;
x++;
if (x <= 5)
{
printf("hi");
main();
}
}
8. What will be the output of the following C code?
#include <stdio.h>
void main()
{
int x = 3;
{
x = 4;
printf("%d", x);
}
}
#include <stdio.h>
void main()
{
int x = 3;
{
x = 4;
printf("%d", x);
}
}
9. Property which allows to produce different executable for different platforms in C is called?
10. Which of the following file extensions are accepted with #include?
Read More Section(Function)
Each Section contains maximum 100 MCQs question on Function. To get more questions visit other sections.