WorksheetsTech Intellect Final Round
Total questions: 30
Worksheet time: 2hrs 30mins
In C programming language, which of the following type of operators have the highest precedence
Relational Operators
Equality Operators
Logical Operators
Arithmetic Operators
200 27500
110 25500
100 25700
150 2000
For 'C' programming language
Constant expressions are evaluated at compile time
String constants can be concatenated at compile time
Size of array should be known at compile time
All of these
Integer division in a 'C' program results in:
Truncation
Rounding
Underflow
None of these
int i = 5; is a statement in a C program.
during execution, value of 'i' may change but not its address
during execution both the address and value may change
repeated execution may result in different addresses for 'i'
'i' may not have an associated address
In a 'C'expression involving || operator, evaluation
Will be stopped if one of its components evaluates to false
Will be stopped if one of its components evaluates to true
Takes place from right to left
None of these
If i j,k are integer variable with values 1,2,3 respectively, then what is the value of the expression !((j + k) > (i + 5))
6
5
1
0
Which of the following operators takes only integer operands ?
+
/
%
*
The declaration "unsigned u" indicates u is a/an
unsigned character
unsigned integer
character
none of these
Which of the following 'C' type is not a primitive data type?
int
float
char
none of these
In C programming language, if the first and the second operands of operator + are of types int and float, respectively, the result will be of type
int
float
char
long int
Choose the correct statements
an identifier may start with an underscore
an identifier may end with an underscore
IF is a valid identifier
All of the above
When a variable of data type double is converted into float, then
Rounding takes place
Truncation takes place
The lower order bits are dropped
None of these
For loop in a C program, if the condition is missing
it is assumed to be present and taken to be false
it is assumed to be present and taken to the true
it result in a syntax error
execution will be terminated abruptly
Which of the following statement about for loop is true?
Index value is retained outside the loop
Index value can be changed from within the loop
goto can be used to jump, out of the loop
All of these
60
59
61
None of these
Which is true of conditional compilation?
it is taken care of by the compiler
it is taken care of by the pre-processor
it is compiling a program based on a condition
both (b) & (c)
Choose the statements that are syntactically correct
/* Is /* this a valid */ comment */
for ( ; ; ) ;
return;
both (b) & (c)
The following program fragment
for (i = 1; i< 5; ++ i )
if ( i == 3) continue;
else printf( " %d " i );
results in the printing of
1 2 4 5
1 2 4
2 4 5
None of the above
The following program fragment
if (a = 0) printf ("a is zero");
else printf ("a is not zero");
results in the printing of
a is zero
a is not zero
nothing
garbage
The following program fragment
if ( a = 7 )
printf (" a is seven ");
else
printf (" a is not seven ");
results in the printing of
a is seven
a is not seven
nothing
garbage
The following Program
main()
{
int i = 5;
if (i == 5) return;
else printf (" is not five");
printf("over");
}
results in
a syntax error
an execution error
printing of over
execution termination, without printing anything
The following statement
if (a > b)
if (c > b)
printf("one");
else
if (c == a) printf('two');
else printf("three");
else printf("four");
results in a syntax error
prints four in c <= b
prints two if c <= h
prints four in a <= b
Using goto inside for loop is equivalent to using
continue
break
return
none of the above
Consider the following program fragment
d = 0;
for(i = 1; i < 31; ++i)
for(j = 1; j < 31; ++j)
for(k = 1; k < 31; ++k)
if(((i + j + k) % 3) == 0)
d = d + 1;
printf("%d", d );
The output will be
9030
27000
3000
none of the above
Consider the program fragment
j = 2;
while ((i % j) ! = 0)
j = j + 1;
if (j < i) printf ("%d", j);
If i >= 2, then the value of j, will be printed only if
i is prime
j does not divide i
j is odd
i is not prime
Which is valid C expression?
int my_num = 100,000;
int my_num = 100000;
int my num = 1000;
int $my_num = 10000;
It will cause a compile time error
It will cause a run time error
It will run without any error and prints 3
It will experience infinite looping
In mathematics and computer programming, which is the correct order of mathematical operators?
Addition, Subtraction, Multiplication, Division
Division, Multiplication, Addition, Subtraction
Multiplication, Addition, Division, Subtraction
Addition, Division, Modulus, Subtraction
Which of the following cannot be checked in a switch-case statement?
Character
Integer
Float
enum
