TCS Technical Questions With Solutions

1.
Which of this is used to skip one iteration:

A. break
B. continue
C. goto
D. return

 

2.
Which of the following does not require to include math.h header file?

A. pow()
B. rand()
C. sqrt()
D. sinh()

3.
Which has the highest precision?

A. float
B. double
C. unsigned long int
D. Long int

4.
Choose the correct statement
while (0 == 0) { }

A. It has syntax error as there are no statements within braces {}
B. It will run forever
C. It compares 0 with 0 and since they are equal it will exit the loop immediately
D. It has syntax error as the same number is being compared with itself

5.
Predict the output of the following code:

main()
{
int a=10,x;
x= a– + ++a;
printf(“%d”,x);
}
A. 19
B. 20
C. 22
D. 23

 

Visitor Counter

0056680