1.
P{margin-bottom:0.21cm;direction:ltr;color:rgb(0,0,0);}P.western{font-family:"Liberation Serif","Times New Roman",serif;font-size:12pt;}P.cjk{font-family:"WenQuanYi Micro Hei";font-size:12pt;}P.ctl{font-family:"Lohit Hindi";font-size:12pt;}Which of these is a valid variablename?
P { margin-bottom: 0.21cm; direction: ltr; color: rgb(0, 0, 0); }P.western{font-family:"Liberation Serif","Times New Roman",serif;font-size:12pt;}P.cjk{font-family:"WenQuanYi Micro Hei";font-size:12pt;}P.ctl{font-family:"Lohit Hindi";font-size:12pt;}Which of these is a valid variablename?
P { margin-bottom: 0.21cm; direction: ltr; color: rgb(0, 0, 0); }P.western{font-family:"Liberation Serif","Times New Roman",serif;font-size:12pt;}P.cjk{font-family:"WenQuanYi Micro Hei";font-size:12pt;}P.ctl{font-family:"Lohit Hindi";font-size:12pt;}
Which of these is a valid variable name?
A. 
B. 
C. 
D. 
2.
P{margin-bottom:0.21cm;direction:ltr;color:rgb(0,0,0);}P.western{font-family:"Liberation Serif","Times New Roman",serif;font-size:12pt;}P.cjk{font-family:"WenQuanYi Micro Hei";font-size:12pt;}P.ctl{font-family:"Lohit Hindi";font-size:12pt;}
P{margin-bottom:0.21cm;direction:ltr;color:rgb(0,0,0);}P.western{font-family:"Liberation Serif","Times New Roman",serif;font-size:12pt;}P.cjk{font-family:"WenQuanYi Micro Hei";font-size:12pt;}P.ctl{font-family:"Lohit Hindi";font-size:12pt;}
What is the output of the following code snippet?
Main() {
float x=0.1f;
while(x<1.0) x += 0.1f;
printf(“%f”, x);
}
A. 
B. 
C. 
D. 
Floats can't be compared in a while
3.
P { margin-bottom: 0.21cm; direction: ltr; color: rgb(0, 0, 0); }P.western { font-family: "Liberation Serif","Times New Roman",serif; font-size: 12pt; }P.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }P.ctl { font-family: "Lohit Hindi"; font-size: 12pt; }
What is the output in the following code
int i;
for(i=0; i<5; i++);
printf(“%d\t”, i);
A. 
B. 
C. 
D. 
4.
P{margin-bottom:0.21cm;direction:ltr;color:rgb(0,0,0);}P.western{font-family:"Liberation Serif","Times New Roman",serif;font-size:12pt;}P.cjk{font-family:"WenQuanYi Micro Hei";font-size:12pt;}P.ctl{font-family:"Lohit Hindi";font-size:12pt;}
Void func(char **p) {
p++;
}
int main()
{
char *a = “Hello, World”;
func(&a);
printf(“%s\n”,a);
return 0;
}
A. 
B. 
C. 
D. 
5.
P { margin-bottom: 0.21cm; direction: ltr; color: rgb(0, 0, 0); }P.western { font-family: "Liberation Serif","Times New Roman",serif; font-size: 12pt; }P.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }P.ctl { font-family: "Lohit Hindi"; font-size: 12pt; }
Which of the following best describes the error in the code given below
void main() {
int p, *n;
n = &p;
scanf(''%d'', n),
printf(''%d '', p);
return 0;
}
A. 
Parameter to scanf should be &n, not n
B. 
The variable p is uninitialized
C. 
Scanf statement should be terminated by semicolon
D. 
Cannot return 0 from main
6.
P { margin-bottom: 0.21cm; direction: ltr; color: rgb(0, 0, 0); }P.western { font-family: "Liberation Serif","Times New Roman",serif; font-size: 12pt; }P.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }P.ctl { font-family: "Lohit Hindi"; font-size: 12pt; }
I was doing a long OS recognition program. Can you find an error in my code?
print_Windows() {
printf(“Hello, You are using MS Windows”);
}
print_MacOS() {
printf(“Hello there, You are using Mac OS”);
}
print_Ubuntu() {
printf(“Hello, You are using Ubuntu Linux”);
}
print_HP-UX() {
printf(“Hello, You are using HP-UX”);
}
A. 
The functions dont have return types, so compiler error
B. 
OS-specific functions cannot be executed in C, so runtime error
C. 
D. 
D. Nothing, code runs fine
7.
P { margin-bottom: 0.21cm; direction: ltr; color: rgb(0, 0, 0); }P.western { font-family: "Liberation Serif","Times New Roman",serif; font-size: 12pt; }P.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }P.ctl { font-family: "Lohit Hindi"; font-size: 12pt; }
What will be the value of x and y, assuming 4 bytes integer?
int fun(int arr[10])
{
x = sizeof(arr);
}
int main()
{
int arr[10];
y = sizeof(arr);
fun(arr);
}
A. 
B. 
C. 
D. 
8.
P { margin-bottom: 0.21cm; direction: ltr; color: rgb(0, 0, 0); }P.western { font-family: "Liberation Serif","Times New Roman",serif; font-size: 12pt; }P.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }P.ctl { font-family: "Lohit Hindi"; font-size: 12pt; }
Find the output of the following code snippet
int x = 190;
printf(“%c\n”, !x);
A. 
B. 
C. 
D. 
9.
P { margin-bottom: 0.21cm; direction: ltr; color: rgb(0, 0, 0); }P.western { font-family: "Liberation Serif","Times New Roman",serif; font-size: 12pt; }P.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }P.ctl { font-family: "Lohit Hindi"; font-size: 12pt; }
How many types of pre-processor directives are there in C
A. 
B. 
C. 
D. 
As many as the user wants
10.
P{margin-bottom:0.21cm;direction:ltr;color:rgb(0,0,0);}P.western{font-family:"Liberation Serif","Times New Roman",serif;font-size:12pt;}P.cjk{font-family:"WenQuanYi Micro Hei";font-size:12pt;}P.ctl{font-family:"Lohit Hindi";font-size:12pt;}
What is FALSE about static functions?
A. 
They can be called from other functions
B. 
They can have return types other than int
C. 
They can be called from other source files
D. 
Their local variables are initialized every time they are called
11.
P { margin-bottom: 0.21cm; direction: ltr; color: rgb(0, 0, 0); }P.western { font-family: "Liberation Serif","Times New Roman",serif; font-size: 12pt; }P.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }P.ctl { font-family: "Lohit Hindi"; font-size: 12pt; }
What is the output of the following code:
extern int x;
int main() {
printf(“%d\n”,x);
}
A. 
B. 
C. 
D. 
12.
P { margin-bottom: 0.21cm; direction: ltr; color: rgb(0, 0, 0); }P.western { font-family: "Liberation Serif","Times New Roman",serif; font-size: 12pt; }P.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }P.ctl { font-family: "Lohit Hindi"; font-size: 12pt; }
What is TRUE about void pointers?
A. 
They can point to any other type of data
B. 
C. 
D. 
They cannot be passed as function arguments
13.
P{margin-bottom:0.21cm;direction:ltr;color:rgb(0,0,0);}P.western{font-family:"Liberation Serif","Times New Roman",serif;font-size:12pt;}P.cjk{font-family:"WenQuanYi Micro Hei";font-size:12pt;}P.ctl{font-family:"Lohit Hindi";font-size:12pt;}
Given below are two statements. Which option relating to the statements is true?
A: Every C program has to include stdio.h
B: stdio.h contains functions like scanf and printf
A. 
Statement A is true and Statement B is the reason for it
B. 
Statement A is true but Statement B is not the reason for it
C. 
Statement A is false but Statement B is correct
D. 
Both the statements are false
14.
P { margin-bottom: 0.21cm; direction: ltr; color: rgb(0, 0, 0); }P.western { font-family: "Liberation Serif","Times New Roman",serif; font-size: 12pt; }P.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }P.ctl { font-family: "Lohit Hindi"; font-size: 12pt; }
What is the error in the following code?
#define VAL 15
int main ()
{
#ifndef VAL
while(1) {
printf(“Hello”)
}
#else
printf(“Hi”);
}
A. 
Pre-processors cant be defined inside main
B. 
Main function does not return a value
C. 
Semicolon missing after printf
D. 
15.
P { margin-bottom: 0.21cm; direction: ltr; color: rgb(0, 0, 0); }P.western { font-family: "Liberation Serif","Times New Roman",serif; font-size: 12pt; }P.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }P.ctl { font-family: "Lohit Hindi"; font-size: 12pt; }
How many times will the following loop body execute?
unsigned int i;
for(i=-1; i<0; i-- )
{
...
}
A. 
B. 
C. 
D. 
16.
P { margin-bottom: 0.21cm; direction: ltr; color: rgb(0, 0, 0); }P.western { font-family: "Liberation Serif","Times New Roman",serif; font-size: 12pt; }P.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }P.ctl { font-family: "Lohit Hindi"; font-size: 12pt; }
What is the largest possible data type available in C standard?
A. 
B. 
C. 
D. 
17.
P{margin-bottom:0.21cm;direction:ltr;color:rgb(0,0,0);}P.western{font-family:"Liberation Serif","Times New Roman",serif;font-size:12pt;}P.cjk{font-family:"WenQuanYi Micro Hei";font-size:12pt;}P.ctl{font-family:"Lohit Hindi";font-size:12pt;}
What is the maximum value that an int can hold?
A. 
B. 
C. 
D. 
18.
P{margin-bottom:0.21cm;direction:ltr;color:rgb(0,0,0);}P.western{font-family:"Liberation Serif","Times New Roman",serif;font-size:12pt;}P.cjk{font-family:"WenQuanYi Micro Hei";font-size:12pt;}P.ctl{font-family:"Lohit Hindi";font-size:12pt;}
P{margin-bottom:0.21cm;direction:ltr;color:rgb(0,0,0);}P.western{font-family:"Liberation Serif","Times New Roman",serif;font-size:12pt;}P.cjk{font-family:"WenQuanYi Micro Hei";font-size:12pt;}P.ctl{font-family:"Lohit Hindi";font-size:12pt;}
What is the output of the following code?
printf(“\nhi”);
printf(“\bsa”);
printf(“\rmo”);
A. 
B. 
C. 
D. 
19.
P { margin-bottom: 0.21cm; direction: ltr; color: rgb(0, 0, 0); }P.western { font-family: "Liberation Serif","Times New Roman",serif; font-size: 12pt; }P.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }P.ctl { font-family: "Lohit Hindi"; font-size: 12pt; }
In which header file are the malloc, calloc and realloc functions found?
A. 
B. 
C. 
D. 
20.
P{margin-bottom:0.21cm;direction:ltr;color:rgb(0,0,0);}P.western{font-family:"Liberation Serif","Times New Roman",serif;font-size:12pt;}P.cjk{font-family:"WenQuanYi Micro Hei";font-size:12pt;}P.ctl{font-family:"Lohit Hindi";font-size:12pt;}
What will be the output:
printf(“%x\n”, -1 << 4);
A. 
B. 
C. 
D. 
21.
P{margin-bottom:0.21cm;direction:ltr;color:rgb(0,0,0);}P.western{font-family:"Liberation Serif","Times New Roman",serif;font-size:12pt;}P.cjk{font-family:"WenQuanYi Micro Hei";font-size:12pt;}P.ctl{font-family:"Lohit Hindi";font-size:12pt;}
What will be the output of the following code snippet?
int arr[] = {1,2,3,4,5};
for (i=-1; i<(sizeof(arr)/sizeof(arr[0]))-1; i++)
printf(“%d\t”, arr[i+1]);
A. 
B. 
C. 
D. 
No errors, but doesn't output anything
22.
P { margin-bottom: 0.21cm; direction: ltr; color: rgb(0, 0, 0); }P.western { font-family: "Liberation Serif","Times New Roman",serif; font-size: 12pt; }P.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }P.ctl { font-family: "Lohit Hindi"; font-size: 12pt; }
Which of these will print the 3rd element of an array a?
A. 
B. 
C. 
D. 
23.
P { margin-bottom: 0.21cm; direction: ltr; color: rgb(0, 0, 0); }P.western { font-family: "Liberation Serif","Times New Roman",serif; font-size: 12pt; }P.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }P.ctl { font-family: "Lohit Hindi"; font-size: 12pt; }
Which of these user-defined function definitions is illegal
A. 
B. 
C. 
D. 
Int FUNCTION(int (*fp)(int));
24.
P { margin-bottom: 0.21cm; direction: ltr; color: rgb(0, 0, 0); }P.western { font-family: "Liberation Serif","Times New Roman",serif; font-size: 12pt; }P.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }P.ctl { font-family: "Lohit Hindi"; font-size: 12pt; }
How many bytes does the following declaration takes in data segment of the memory? (Consider a 4-bytes int and 8-byte double)
struct somestruct {
int a;
double b;
char c;
};
A. 
B. 
C. 
D. 
25.
P { margin-bottom: 0.21cm; direction: ltr; color: rgb(0, 0, 0); }P.western { font-family: "Liberation Serif","Times New Roman",serif; font-size: 12pt; }P.cjk { font-family: "WenQuanYi Micro Hei"; font-size: 12pt; }P.ctl { font-family: "Lohit Hindi"; font-size: 12pt; }
Generally what is the size of an int in C?
A. 
B. 
C. 
Cannot say, implementation dependant
D. 
The word size of the compiler