1.
Can we write a function that takes a variable argument list and passes the list to another function?
2.
What will be the output of the program in Turbo C?
#include
int main()
{
char str[10] = "Choice";
str[6] = "User";
printf("%s\n", str);
return 0;
}
A. 
B. 
C. 
D. 
3.
What will be the output of the program ?
#include
int main()
{
int i;
char a[] = "\0";
if(printf("%s", a))
printf("The string is empty\n");
else
printf("The string is not empty\n");
return 0;
}
A. 
B. 
C. 
D. 
4.
If the size of pointer is 32 bits What will be the output of the program ?
#include
int main()
{
char a[] = "Visual C++";
char *b = "Visual C++";
printf("%d, %d\n", sizeof(a), sizeof(b));
printf("%d, %d", sizeof(*a), sizeof(*b));
return 0;
}
A. 
B. 
C. 
D. 
5.
What will be the output of the program?
#include
#include
int main()
{
char dest[] = {97, 97, 0};
char src[] = "aaa";
int i;
if((i = memcmp(dest, src, 2))==0)
printf("Got it");
else
printf("Missed");
return 0;
}
A. 
B. 
C. 
Error in memcmp statement
D. 
6.
What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample Jan Feb Mar
/* sample.c */
#include
#include
int main(int arc, char *arv[])
{
int i;
for(i=1; i<_argc; i++)
printf("%s ", _argv[i]);
return 0;
A. 
B. 
C. 
D. 
7.
What will be the output of the program (sample.c) given below if it is executed from the command line?
cmd> sample one two three
/* sample.c */
#include
int main(int argc, char *argv[])
{
int i=0;
i+=strlen(argv[1]);
while(i>0)
{
printf("%c", argv[1][--i]);
}
return 0;
}
A. 
B. 
C. 
D. 
8.
What will be the output of the program
#include
void fun(int);
int main(int argc)
{
printf("%d\n", argc);
fun(argc);
return 0;
}
void fun(int i)
{
if(i!=4)
main(++i);
}
A. 
B. 
C. 
D. 
9.
What is the output of the program
#include
int main()
{
int x = 10, y = 20, z = 5, i;
i = x < y < z;
printf("%d\n", i);
return 0;
}
A. 
B. 
C. 
D. 
10.
What is the output of the program given below ?
#include
int main()
{
enum status { pass, fail, atkt};
enum status stud1, stud2, stud3;
stud1 = pass;
stud2 = atkt;
stud3 = fail;
printf("%d, %d, %d\n", stud1, stud2, stud3);
return 0;
}
A. 
B. 
C. 
D. 
11.
Which files will get closed through the fclose() in the following program?
#include
int main()
{
FILE *fs, *ft, *fp;
fp = fopen("A.C", "r");
fs = fopen("B.C", "r");
ft = fopen("C.C", "r");
fclose(fp, fs, ft);
return 0;
}
A. 
B. 
C. 
D. 
12.
Assunming, integer is 2 byte, What will be the output of the program?
#include
int main()
{
printf("%x\n", -2<<2);
return 0;
}
A. 
B. 
C. 
D. 
13.
What will be the output of the program?
#include
int main()
{
int fun(int);
int i = fun(10);
printf("%d\n", --i);
return 0;
}
int fun(int i)
{
return (i++);
}
A. 
B. 
C. 
D. 
14.
What will be the output of the program in 16 bit platform (Turbo C under DOS) ?
#include
int main()
{
struct value
{
int bit1:1;
int bit3:4;
int bit4:4;
}bit;
printf("%d\n", sizeof(bit));
return 0;
}
A. 
B. 
C. 
D. 
15.
What will be the output of the program?
#include
int addmult(int ii, int jj)
{
int kk, ll;
kk = ii + jj;
ll = ii * jj;
return (kk, ll);
}
int main()
{
int i=3, j=4, k, l;
k = addmult(i, j);
l = addmult(i, j);
printf("%d %d\n", k, l);
return 0;
}
A. 
B. 
C. 
D. 
16.
In the following program where is the variable a getting defined and where it is getting declared?
#include
int main()
{
extern int a;
printf("%d\n", a);
return 0;
}
int a=20;
A. 
Extern int a is declaration, int a = 20 is the definition
B. 
Int a = 20 is declaration, extern int a is the definition
C. 
Int a = 20 is definition, a is not defined
D. 
A is declared, a is not defined
17.
What are the types of linkages?
A. 
B. 
External, Internal and None
C. 
D. 
18.
Which of the following statements are correct about the program?
#include
int main()
{
printf("%p\n", main());
return 0;
}
A. 
It prints garbage values infinitely
B. 
Runs infinitely without printing anything
C. 
Error: main() cannot be called inside printf()
D. 
No Error and print nothing
19.
We want to round off x, a float, to an int value, The correct way to do is
A. 
B. 
C. 
D. 
20.
Which of the following statements are correct about the below C-program?
#include
int main()
{
int x = 10, y = 100%90, i;
for(i=1; i<10; i++)
if(x != y);
printf("x = %d y = %d\n", x, y);
return 0;
}
1 :
The printf() function is called 10 times.
2 :
The program will produce the output x = 10 y = 10
3 :
The ; after the if(x!=y) will NOT produce an error.
4 :
The program will not produce output.
A. 
B. 
C. 
D. 
21.
What will be the output of the program?
#include
int main()
{
int k, num=30;
k = (num>5 ? (num <=10 ? 100 : 200): 500);
printf("%d\n", num);
return 0;
}
A. 
B. 
C. 
D. 
22.
Point out the error in the following program.
#include
int main()
{
struct emp
{
char name[20];
float sal;
};
struct emp e[10];
int i;
for(i=0; i<=9; i++)
scanf("%s %f", e[i].name, &e[i].sal);
return 0;
}
A. 
Suspicious pointer conversion
B. 
Floating point formats not linked (Run time error)
C. 
Cannot use scanf() for structures
D. 
Strings cannot be nested inside structures
23.
The keyword used to transfer control from a function back to the calling function is
A. 
B. 
C. 
D. 
24.
Which of the following statements are correct about the function?
long fun(int num)
{
int i;
long f=1;
for(i=1; i<=num; i++)
f = f * i;
return f;
}
A. 
The function calculates the value of 1 raised to power num.
B. 
The function calculates the square root of an integer
C. 
The function calculates the factorial value of an integer
D. 
25.
Which of the statements is correct about the program?
#include
int main()
{
float a=3.14;
char *j;
j = (char*)&a;
printf("%d\n", *j);
return 0;
}
A. 
It prints ASCII value of the binary number present in the first byte of a float variable a.
B. 
It prints character equivalent of the binary number present in the first byte of a float variable a.
C. 
D. 
It will print a garbage value