Tuesday 20 March 2012

C Language MCQ


C Language MCQ
1.      Which is the C IDE:

a.       GNU gcc compiler
b.      Borland C++ compiler
c.       Turbo C++ IDE
d.      Visual Studio
e.      All of Above

2.      C us supported by the following operating system:

a.       Unix
b.      Linux
c.       Windows
d.      All of above

3.      C is the ________ language:

a.       Low level
b.      High Level
c.       Both Low and High Level
d.      None of these

4.      Which is not the feature of c language:

a.       Portable
b.      Terse
c.       Modular
d.      Efficient
e.      None of these

5.      You require to write and run c program:

a.       Operating system
b.      Text editor
c.       Compiler
d.      All of above

6.      which is the shortcut key to compile program in Turbo C IDE:

a.       Ctrl + F9
b.      Alt + F9
c.       Ctrl + F5
d.      None of these

7.      C has _______ keywords:

a.       30
b.      31
c.       32
d.      33

8.      Which is the type of int:

a.       Int
b.      Unsigned int
c.       Long
d.      Unsigned long
e.      All of above

9.      Which is not the valid integer:

a.       +345
b.      345UL
c.       123U
d.      123.0

10.  Which is the invalid octal:

a.       0346
b.      0452
c.       0255
d.      0840

11.  Which is invalid hexadecimal:

a.       0x345
b.      0xA132
c.       0xG120
d.      0x452F

12.  The ASCII value of Y:

a.       88
b.      89
c.       90
d.      91

13.  Which is not the fundamental data types:

a.       Char
b.      Array
c.       Int
d.      Float

14.  Variable is a:

a.       Location in memory
b.      Location in CPU Registers
c.       Both
d.      None of these

15.  Which is not the type of variable

a.       Extrern
b.      Register
c.       Global
d.      None of above

16.  Which is the invalid identifiers name:

a.       Pushp1
b.      _pushp
c.       1Pushp
d.      pushp_infotech

17.  int can store:

a.       Real numbers
b.      Characters
c.       String
d.      None of these

18.  Which is not the type of variable initializations:

a.       Static
b.      Dynamic
c.       Both
d.      None of these

19.  In c language ‘\a’ used for:

a.       Form feed
b.      Line Brack
c.       Alarm
d.      None of these

20.  The Arithmetic operator ‘%’ can be used with:

a.      int
b.      float
c.       double
d.      void

21.  ‘%d’ is the conversion letter for:

a.       char
b.      int
c.       float
d.      double

22.  printf(“%c”, 65); Out of this line is:

a.       65
b.      A
c.       Both
d.      None of these

23.  Binary operator needs:

a.       One operand
b.      Two operand
c.       Three operand
d.      None of these

24.  Which is the symbol for AND operator:

a.       ||
b.      &&
c.       $$
d.      None of these

25.  printf(“0 && 1 = %d\n”, 0 && 1); Out of this line is:

a.      0 && 1 = 0
b.      0 && 1 = 1
c.       0 && 1 = 2
d.      0 && 1 = 3

26.  int x=10;
            printf("%d",x++);      Output is:

a.      10
b.      11
c.       12
d.      None of these

27.  >> operator is used for:

a.      Right Shift
b.      Left Shift
c.       Both
d.      None of these

28.  char x=10;
            printf("%d",~x);         Output is:

a.       10
b.      -10
c.       -11
d.      None of these

29.    printf("%d",sizeof(int)); Output is:

a.       1
b.      2
c.       6
d.      10

30.  C program starts executing from:

a.      main()
b.      header file
c.       both
d.      None of these

31.  Which is the incorrect statement:
a.       Variable name can contain underscore.
b.      Variable name may start from digit.
c.       Variable name may not have white space character.
d.      Keyword can not be a variable name.
32.  Uninitialized variable may have:

a.      Garbage value.
b.      Can not be zero
c.       Both
d.      None of these.

33.  Which is the correct variable name:

a.       for
b.      goto
c.       character
d.      if

34.  Which is not the c keyword:

a.       typedef
b.      extern
c.       register
d.      local

35.  Which operator is used to assign value to variables:

a.      =
b.      +
c.      
d.      /

36.  ‘\n’ used for

a.       Alert
b.      New line
c.       Form feed
d.      Backspace

37.  printf(“%u”,&a); The output of this statement is:

a.       Value of a
b.      Address of a
c.       Both
d.      None of these.

38.  String is:

a.       Array of numbers.
b.      Array of characters.
c.       Both
d.      None of these.

39.  Which is the string termination character:

a.       ‘\n’
b.      ‘\b’
c.       ‘\0’
d.      None of these

40.  char *name= “India”;
strupr(name);
puts(name);  Output of this program is:

a.       India
b.      india
c.       INDIA
d.      iNDIA

41.  Which is not the string handling function:

a.       strlwr();
b.      strcat();
c.       strcmp()
d.      strrev();
e.       strlen();
f.        None of these.

42.  Which statement is wrong:
a.       A function may have arguments.
b.      A function may return value.
c.       A can be invoked many time in a single program.
d.      Function cannot be reused.
43.  A function can return only _______

a.      Single value
b.      Two Values.
c.       Many values.
d.      None of these

44.  Mathematical function are stored in _________ header file:

a.       stdio.h
b.      conio.h
c.       math.h
d.      string.h

45.  A function which invokes itself repeatedly until some condition is satisfied is called a ___________ function.

a.      Recursive
b.      System
c.       Library
d.      None of these

46.  ++ is ________ operator:

a.       Decrement
b.      Increment
c.       Add
d.      Plus-Plus

47.  Which is the incorrect statement:
a.       An array is the collection of variables.
b.      All array variables have same type.
c.       Array variables can be used individually.
d.      None of these.
48.  An array can be declared:

a.      Statically
b.      Dynamically
c.       Both
d.      None of these

49.  Array can be:

a.       Single Dimensional
b.      Multi Dimensional
c.       Both
d.      None of these

50.  Array index is always starts from:

a.      0
b.      1
c.       2
d.      3

51.  An array is ____________ data-structure:

a.      Linear
b.      Non-linear
c.       Hierarchical
d.      None of these

52.  Which is the false statement:
a.       An array of characters is called string.
b.      Array can be passed to function.
c.       Array is always reference type.
d.      None of these
53.  Array can be sorted by using:

a.       Bubble Sort
b.      Merge Sort
c.       Quick Sort
d.      All of above

54.  Which term is not related to function:

a.       Prototype
b.      Definition
c.       Call
d.      Receive

55.  Which is the type of function arguments:

a.       Formal
b.      Actual
c.       Both
d.      None of these

56.  Which not the input function:

a.       gets();
b.      getch();
c.       getchar();
d.      scanf();
e.       getche();
f.        None of these.

57.  Which is not the output function:

a.       printf();
b.      puts();
c.       puchar();
d.      putch();
e.      None of these.

58.  int add(int,int); in the given function prototype select the correct statement:

a.       int x=add(4.2,5);
b.      int x=add(4,25);
c.       int x=add(425);
d.      int x=add();

59.  A pointer variable can store ________
a.       Constant value
b.      Value of anther variable.
c.       Address of another variable
d.      None of these.
60.  int *ptr; here ptr can store the address of:

a.      int variable
b.      float variable
c.       double variable
d.      All of above

61.  int x=10;
int *y=&x; the variable y contains:

a.       Value of x;
b.      Address of x;
c.       Both
d.      None of these

62.  int **ptr; here ptr is:

a.       Pointer
b.      Pointer to pointer
c.       Both
d.      None of these

63.  In the call by reference we pass:

a.       Value of the variable
b.      Address of variable
c.       Both value and address
d.      None of these

64.  int a[3]={4,5,6};
printf(“%u”,a); What is the output:

a.       Value of first element.
b.      Address of first element
c.       Both
d.      None of these

65.  Which function is related to dynamic memory allocation:

a.       malloc();
b.      calloc()
c.       realloc()
d.      All of above.

66.  strcmp() function is used for:

a.       Copy two strings
b.      Compare two strings.
c.       Concatenation of two strings
d.      None of these

67.  Which is the formatted input function:

a.       getch();
b.      scanf();
c.       gets();
d.      getche();

68.  Which is the incorrect function prototype:

a.       int add(int,int);
b.      int add(float, int);
c.       float add(int,int);
d.      float add(float,int);

69.  Which is the incorrect function prototype based on c library:

a.       char *gets(char *string);
b.      int puts(const char*s);
c.       char *cgets(char *str);
d.      int cputs(const char*str);
e.      None of these

70.  Which is the type of files:

a.       Text
b.      Binary
c.       Both
d.      None of these

71.  Which function is not related to file handling:

a.       fopen();
b.      fclose();
c.       fprintf();
d.      printf();

72.  Which is the file opening mode:

a.       r
b.      w
c.       rb
d.      wb
e.       a
f.        All of above

73.  A structured programming have:

a.       Sequence
b.      Selection
c.       Iteration
d.      All of Above

74.  Which is not the selective control flow statement:

a.      while
b.      if
c.       Switch-case
d.      if-else

75.  Which is the correct example of label:

a.       Label;
b.      Label:
c.       Label,
d.      #Label

76.  Who is the manufacturer of C language:

a.       Herbert Schieldt
b.      Banjarne Stroups
c.       Dennis Ritchie
d.      None of these

77.  C is the __________ language:

a.       Object Oriented
b.      Structured
c.       Unified Modeling
d.      None of these.

78.  An efficient algorithm ______

a.       Takes efficient time
b.      Takes efficient memory
c.       Both
d.      None of these

79.  Which technique is related to internal code:

a.       Black Box
b.      White Box
c.       Alfa
d.      Beta

80.  Which is the type of white box testing:

a.       Path Testing
b.      Loop Testing
c.       Domain Testing.
d.      All of these


19 comments :

  1. Good...add more advanced question.i mean programming type

    ReplyDelete
  2. it is good collection for beginners add more fundamental question on Data types

    ReplyDelete
  3. Thanx .. and upload c++ Mcq.

    ReplyDelete
  4. Nice but add some more programming ques

    ReplyDelete
  5. Thanks and upload more c questions

    ReplyDelete
  6. Your good knowledge and kindness in playing with all the pieces were very useful. I don’t know what I would have done if I had not encountered such a step like this.Thanks lot!!


    Android Training in Chennai

    Android Online Training in Chennai

    Android Training in Bangalore

    Android Training in Hyderabad

    Android Training in Coimbatore

    Android Training

    Android Online Training

    ReplyDelete
  7. These really helped me with an MCQ-based term test. Thank you, sir. Would you please create one for C++ also? cheapest essay writing services usa

    ReplyDelete
  8. Such a Nice post. Thanks for Awesome tips Keep it up
    turbo-studio-crack

    ReplyDelete
  9. What a great article! This is so jam-packed with valuable information that I can't wait to go in and apply the tools you've provided. Your enthusiasm is admirable.
    Visit our website for additional details about IT professional certification.
    python training in pune

    ReplyDelete
  10. This essay is fantastic! This is so filled with useful information that I can't wait to use the tools you've provided to get started. Your zeal is commendable.
    Best MEC Colleges in Hyderabad


    ReplyDelete
  11. reading this article was really interesting.I want to express my gratitude for all of your hard work in creating this fantastic essay. Searching for the top training for speaking English Best Colleges in Hyderabad For BBA

    ReplyDelete