31. Comment on the following 2 C programs.
#include <stdio.h> //Program 1
int main()
{
int a;
int b;
int c;
}
#include <stdio.h> //Program 2
int main()
{
int a;
{
int b;
}
{
int c;
}
}
#include <stdio.h> //Program 1
int main()
{
int a;
int b;
int c;
}
#include <stdio.h> //Program 2
int main()
{
int a;
{
int b;
}
{
int c;
}
}
32. What will be the output of the following C code?
#include <stdio.h>
void main()
{
static int x;
printf("x is %d", x);
}
#include <stdio.h>
void main()
{
static int x;
printf("x is %d", x);
}
33. #include <somefile.h> are . . . . . . . . files and #include "somefile.h" . . . . . . . . files.
34. What will be the output of the following C code snippet?
#include (stdio.h)
void main()
{
printf("hello");
}
#include (stdio.h)
void main()
{
printf("hello");
}
35. What will be the output of the following C code?
#include <stdio.h>
#define foo(m, n) m ## n
void myfunc();
int main()
{
myfunc();
}
void myfunc()
{
printf("%d\n", foo(2, 3));
}
#include <stdio.h>
#define foo(m, n) m ## n
void myfunc();
int main()
{
myfunc();
}
void myfunc()
{
printf("%d\n", foo(2, 3));
}
36. Register storage class can be specified to global variables.
37. What will be the output of the following C code?
#include <stdio.h>
void main()
{
m();
m();
}
void m()
{
static int x = 5;
x++;
printf("%d", x);
}
#include <stdio.h>
void main()
{
m();
m();
}
void m()
{
static int x = 5;
x++;
printf("%d", x);
}
38. Which of the following are C preprocessors?
39. What will be the output of the following C code?
#include <stdio.h>
#define MIN 0
#ifdef MIN
#define MAX 10
#endif
int main()
{
printf("%d %d\n", MAX, MIN);
return 0;
}
#include <stdio.h>
#define MIN 0
#ifdef MIN
#define MAX 10
#endif
int main()
{
printf("%d %d\n", MAX, MIN);
return 0;
}
40. Which of the following function declaration is illegal?
Read More Section(Function)
Each Section contains maximum 100 MCQs question on Function. To get more questions visit other sections.