RISE
KRISHNA SAI GANDHI GROUP OF INSTITUTIONS::ONGOLE
DEPARTMENT
OF CSE
TECHNICAL
TEST-1(C LANGUAGE)
1. Which
of the following is not a data type
A.
float B. integer C. long
D. char
2. What
is ternary operator
A.
?; B. += C. ?:
D. ?=
3. What is the output of this C
code?
#include <stdio.h>
int main()
{
intvar=010;
printf("%d",var);
}
A. 2 B. 8
C. 9 D. 10
4. What is the value of x in this C
code?
#include <stdio.h>
void main()
{
int x =5*9/3+9;
}
A. 3.75 B. Depends on compiler C. 24
D. 3
5. What is the output of this C
code?
#include <stdio.h>
void main()
{
int x =5.3%2;
printf("Value of x is %d", x);
}
A. Value of
x is 2.3 B. Value of x is 1 C. Value of x is 0.3 D. Compile time error
6. c=++a
– b will result in which of the following (if a=10, b=5)______
A. 5
B. 6C. 7 D. -6
7. What is the output of this C
code?
#include <stdio.h>
int main()
{
inti=-3;
int k =i%2;
printf("%d\n", k);
}
A. Compile time error B. -1
C. 1 D. Implementation defined
8. What
is the output for X=’A’-2;
A. 63B.
65C. 64D. 66
9. Which of the
following shows the correct hierarchy of arithmetic operations in C
A. / + * -
B. * - / + C. + - / *D. * / + -
10. What will be the
output of 5.0 / 2?
A. 2 B.
3 C. 0
D. 2.5
11. Bitwise operators
can operate upon?
A. double and chars B. floats and doubles C. ints and floats D. ints and chars
12. What is the work
of break keyword?
A. Halt execution of program B. Restart execution of program C. Exit
from loop or switch statement D. None
of the avobe
13.
Which of the following represents the end of the string
A. \0 B.
\pC. \nD. \1
14. What
is the output for while(1) { }
A. 1B.
0C. compile errorD. infinite loop
15.
Which of the following is the correct syntax for initialization of an
array___
A.
n[3]={0 0 0 };B. n[3]={0,0,0};C. n[3]={0;0;0};D. n[3]=0;
16. ASCII
17. RAM
18. EEPROM
19. MSDOS
20. BIOS
21. URL
22.4GL
23. BCPL
24. AT&T
25. EBCDIC
26. Write
the logic for printing digit in a word
27. Write
the logic for greatest among two numbers using conditional expression
28. Write
the logic for reverse number
29. Write the
logic for even or odd number
30. Write
the logic for factorial of a given number
No comments:
Post a Comment