Technology
INSTRUCTIONS
Its a evaluation test to qualify in our training / placement process
This test includes Technical. There are 40 questions for you to attempt
You will have 20 minutes to attempt all the questions
Which of the following cannot be a variable name in C?
export
True
friend
Volatile
Which of the following are C preprocessors?
#ifdef
All of the mentioned.
#define
#endif
A variable declared in a function can be used in main?
None of the mentioned
True if it is declared static
False
True
What is the output of this C code?
int foo();
int main()
{
int i = foo();
}
foo()
{
printf("2 ");
return 2;
}
Compile time error
Depends on the standard
2
Depends on the compiler
What is the default return type if it is not specified in function definition?
int
void
double
short int
What is the output of this C code?
int main()
{
void foo();
void f()
{
foo();
}
f();
}
void foo()
{
printf("2 ");
}
2
Depends on the compiler
2 2
Compile time error
Which is valid C expression?
int my_num = 100000;
int $my_num = 10000;
int my num = 1000;
int my_num = 100,000;
functions can return structure in c?
false
true
Depends on the standard
Depends on the compiler
Does this compile without error?
int main()
{
int k;
{
int k;
for (k = 0; k < 10; k++);
}
}
No
Depends on the compiler
Yes
Depends on the C standard implemented by compilers
What is the output of this C code?
int main()
{
printf("AllIndiaExams\r\nclass\n");
return 0;
}
classundry
All India Exams class
India Exams class
All India Exams
Which keyword is used to come out of a loop only for that iteration?
None of the mentioned
continue
break
return
C99 standard guarantees uniqueness of ____ characters for internal names.
31
63
14
12
typedef which of the following may create problem in the program?
All of the mentioned
Arithmetic operators
;
printf/scanf
typedef declaration:
None of the mentioned
It merely adds a new name for some existing type
Both a & b
Does not create a new type
Which of the following is not a valid C variable name?
int $main;
int number;
float rate;
int variable_count;
The following query belongs to which condition types?
SELECT fname
FROM person
WHERE dept_id= (SELECT dept_id FROM department WHERE names=âsâ);
All of the mentioned
Inequality condition
Equality condition
Range condition
What is the output of this C code?
void main()
{
double k = 0;
for (k = 0.0; k < 3.0; k++);
printf("%lf", k);
}
4.000000
3.000000
Run time error
2.000000
The C-preprocessors are specified with _________symbol.estion!
$
None of the mentioned
C
#
Preprocessor feature that supply line numbers and file names to compiler is
called?
Concatenation
Selective inclusion
Line control
macro substitution
What is the output of this C code?
#define a 20
int main()
{
const int a = 50;
printf("a = %d\n", a);
}
Compilation Error
a = 50
a = 20
Run time error
Comment on the output of this C code?
int const print()
{
printf("AllIndiaExams.in");
return 0;
}
void main()
{
print();
}
Runtime Error
complilation error
AllIndiaExams.in is printed infinite number of times
AllIndiaExams.in
functions can return enumeration constants in c?
Both (a) and (b)
return
exit
break
Which of the following is not a valid variable name declaration?
int __A3;
int __3a;
None of the mentioned
int __a3;
All keywords in C are in?
Lower Case letters
Camel Case letters
None
Upper Case letters
What is the output of this C code?
void foo();
int main()
{
void foo();
foo();
return 0;
}
void foo()
{
printf("2 ");
}
2
Depends on the standard
Depends on the compiler
Compile time error
What is the output of this C code?
void main()
{
int k = 4;
float k = 4;
printf("%d", k)
}
4.4
Compile time error
4
4.0000000
Which of the following is not a valid variable name declaration?
int 3_a;
int _3a
int a_3;
int _a3;
enum types are processed by?
Linker
Compiler
Assembler
Preprocessor
What is the output of this C code?
typedef struct p
{
int x, y;
}k;
int main()
{
struct p p = {1, 2};
k k1 = p;
printf("%d\n", k1.x);
}
0
Depends on the standard
Compile time error
1
Which keyword can be used for coming out of recursion?
Both (a) and (b)
break
return
exit
Property which allows to produce different executable for different platforms
in C is called?
Selective inclusion
Conditional compilation
Recursive macros
File inclusion
What is the output of this C code?
int main()
{
int a = 0, i = 0, b;
for (i = 0;i < 5; i++)
{
a++;
continue;
}
}
4
3
2
5
Which of the following is not a valid variable name declaration?
#define PI 3.14
int PI = 3.14;
float PI = 3.14;
double PI = 3.14;
Variable name resolving (number of significant characters for uniqueness of variable) depends on?
None
C Language
Assemblers and loaders implementations
Compiler and linker implementations
What is the output of this C code?
void main()
{
double k = 0;
for (k = 0.0; k < 3.0; k++)
printf("Hello");
}
Hello is printed infinitely
Run time error
Hello is printed thrice
Hello is printed twice
What is the output of this C code?
int main()
{
int y = 10000;
int y = 34;
printf("Hello World! %d\n", y);
return 0;
}
Running time error
Hello World! 34
Compile time error
None
C preprocessors can have compiler specific features.
Depends on the standard
false
true
Depends on the platform
The name of the variable used in one function cannot be used in another function?
May be
None of the mentioned
False
True
What is the output of this C code?
int main()
{
int var = 010;
printf("%d", var);
}
8
9
10
2
What is the output of this C code?
int main()
{
const int a;
a = 32;
printf("a is %d", a);
return 0;
}
a is 32
Compile time error
Run time error
none
Name
Email
Phone