Fundamentals of



Download 9.46 Mb.
Page54/57
Date09.01.2017
Size9.46 Mb.
#8172
1   ...   49   50   51   52   53   54   55   56   57

49. Which of the following is the easiest language to learn and use to write programs?

High level language



(B) Machine level language

(C) Assembly level language

(D) Middle level language



50. Which of the following language is predecessor to C Programming Language?

A (B) B

(C) C++ (D) BCPL

ANSWERS

1. B 2. B 3. D 4. D 5. C 6. D 7. D 8. A 9. B 10. A



(A)

(A)
(A)






11. A

12. D

13. C

14. C

15. A

16. B

17. A

18. C

19. C

20. D

21. A

22. D

23. A

24. B

25. A

26. A

27. D

28. C

29. D

30. C

31. A

32. A

33.C

34. B

35. A

36. C

37. C

38. B

39. A

40. C

41. A

42. C

43. B

44. A

45. D

46. D

47. C

48. C

49. A

50. B

1. :ow will you write comment in a C Program?

A. //


B. // // C. /* */ D. /*

2. Which of the following is FALSE in C?

A. Keyword can be used as variable names

B. Variable names can contain a digit

C. Variable names do not contain a blank space

D. Capital letters can be used in variable names

3. =n „C‟ rithmetic instruction cannot contain

A. Variables

B. Constants

C. Variable names on right side of =

D. Constants on left side of =

4. An expression contains relational operators, assignment operators and arithmetic operators. In the absence of parentheses, they will be evaluated in which of the following order

A. Assignment, Relational, Arithmetic

B. Assignment, Relational, Assignment C. Relational, Arithmetic, Assignment D. Assignment, Arithmetic, Relational



5. In b=6.6/a+2*n; which operation will be performed first?

A. 6.6/a


B. a+2

C. 2*n


D. Depends upon compiler

6. Which among the following is not a structured data type in C?

A. Union B. Pointer C. String

D. Structure

7. Which of the following operator is used to write expression in „C?

A. { } B. ( ) C. [ ]



D. None of above

8. Values of data items of types int, float, char are displayed by writing in printf statement in C

A. %d, %f, %s


B. %f, %d, %c C. %d, %d, %c D. %d, %f, %c



9. The general form of printf statement is

A. printf (\” format string \” list of variables )

B. print (\”list of variables\” format sting)

C. printf (\”format string list of variables \”)

D. print (\” format sting \” list of variables )

10. The statement in C is terminated by

A. { B. : C. ,



D. None above

11. The general form of for statement in C is

A. for (initialize counter, increment, test counter)

B. for (increment counter; initialize counter; test counter) C. for (test counter; increment counter; initialize counter) D. for ( initialize counter; test counter; increment counter)

12. Difference between while and do-while‟

(A) \ 'while \ ' loop executes one or more times and \ 'do-while \' executes zero or more times (B) Both \ 'while \ ' loop and \ 'do- while \' executes one or more times



(C) Both \ 'while \' loop and \ 'do-while \ ' executes zero or more times

(D) \ 'while \ ' loop executes zero or more times and \ 'do-while \' executes one or more times



13. To avoid the repetition of same code we are using.

(A) Array (C) Function

(B) Function (D) Structure

14. Number of functions that might be called in a 'C' program is

(A) 5 (B) 6

(C)Any number of functions

(D) 1


15. void main()

{

int a=12,b=12;



if(a=b)

printf("a and b are equal");

}

What will be the output of the sample code shown above?



(A) 12

(B) Run time error

(C) Compile time error

(D) a and b are equal




16. Every recursive version has an equivalent (but possibly more or less complex) iterative version, and vice versa: validate this statement.

(A) It is true sometimes

(B) TRUE (C) FALSE

(D) None of above

17. Which element of the array does the expression num*4+ references where num isa name of array?

(A)Forth (B)Third (C)Fifth (D)First



18. In a ' C ' expression, how is a logical' AND ' represented?


(A) &

(C) AND


(B) II (D) &&


19. How do you include a system header file called stdio.h in a ' C ' source file?

(A) #include

(B) #incl \ "stdio.h \"

(C) #includefile (D) #include stdio.h



20. Which one of the following variable name is NOT a valid name?

(A)go_cart (B)go4it

(C)4season (D)run4

21. Which of the following shows the correct priority of arithmetic operators in ' C ' ? (Priority for leftmost operator is highest and priority for the rightmost operator is lowest. Operators with equal priority are separated with the word' or'

(A)**, * or t, + or-

(B)**, *, t, +, - (C)**, t, *, +, ¬ (D)t or *, + or -



22. Which of the following statement transfers the control to the beginning of the loop?

(A) exit (B)break

(C)continue (D)None above

23. A ' do-while' 100.;;> is useful when the statements within the loop must be executed:

(A) Only once (B)At least once (C)More than once (D)None of the above



24. Assuming an unsigned integer is represented using 16 bits, the maximum value that an integer

constant can have is


(A)256

(C)65536


(B)32768 (D)128


25. The break statement is used to exit from?


(A)an \ 'if\ ' statement

(B) \ 'for \' statement

(C)Both from the \ 'if\' and \ 'for \ ' statement (D )The main function



26. The two way selection is implemented using statement.

(A)case (B)else---if (C)switch (D)if---else



27. The getch() function in' C' is_

(A) User defined function

(B) Library function

(C) Both above

(D) None above

28. A pointer is a

(A) Derived data type

(B) User defined data type (C) Abstract data type (D) All of the above

29. Which of the following is correct way of declaring a float pointer

(A)float ptr (B)float *ptr

(C)*float ptr (D)None above

30. In code shown below, which is the line that contains an error?

int fun(int x, y)

{

int z;


return z;

}

(A) 1 (C)3 (B) (D)4



31. Which of the following statements are true for the following Program?

#include

void mainO

{

int x=10, y=100%9; for(i=l;i<=10;i++) if(x!=y);



printf( \ "x=%dy=%d \" ,x,y);

}

(A) The printffunction is called 10 times



(B) The program will produce the output x=10 y=1 (C) The ; after if(x!=y) would produce an error

(D) The program will not produce any output




32. The printf statement is used to _

(A) Print the message on the console (B)Read the data from keyboard (C)To store the value in the memory (D)None ofthe above



33. Which of the following is not infinite loop?

(A) int i=l; while(l) int i=l; while(l){i++;}

(B) fore; ;);

(C) int True=O, false; while(True) { False=I;}

(D) int y,x=O;

34. Array can be initialized, provided they are

(A)Automatic (B)external

(C)static (D)both B & C

35. Which of the following' C '. statement is syntactically correct?


(A)for( ); (C)for( , );

(B)for(;); (D)for( ; ; )




36. Which one of the following is not a valid character specification for C language?


(A)ASCII

(B) Control

(C)Digit

(D) for(; ;)




37. The string manipulation function appends a string to the end of another string


(A)stradd

(C)strcmp

(B )strcat

(D)strcpy





Download 9.46 Mb.

Share with your friends:
1   ...   49   50   51   52   53   54   55   56   57




The database is protected by copyright ©ininet.org 2024
send message

    Main page