Viva Questions

1. What are the advantages of using functions?
     Ans: programming becomes  easier, reduces code length

2. What is a loop?
     Ans: repeats over and over until a condition is true.

3. What are nested loops?
    Ans: a loop with in another loop

4. Give difference between while v.s do-while loop
   Ans: while loops gets executed only if the condition is true, but in do-while statements inside loop               is executed once even the condition is false.

5. what is - void?
6. What is #include?
7. Give two input statements
8. What are Pointers?
9. What are preprocessor directives?
10. What is typecasting?
11. What is dynamic memory management?
12. Data types?
13. Global variables v.s local variables?
14. Conditional operator?
15. What is program compilation?
16. Structures?
17. Unions?
18. Difference between structures and unions?
19. goto statement?
20. What is exit function?
21. What is NULL statement?
22. What is infinite loop?
23 size of operator?
24. Size of variables?
25. Built-in function v.s user-defined functions
26. Recursive function?
27. What is indirect addressing?
28. Break statement?
29. continue statement?
30. bitwise operator?
31. formal arguments and actual aruments?
32. Explain strcat, strrev functions?
33. Arrow operator?
34. What is free()?
35.  user defined variables?
36. Assembler?
37. Compiler?
38. Flowchart?
39. High Level Language?
40. Prototype function declaration?
41. Function definition?
42. Use of return statement?
43. Compare = v.s == ?
44. Types of operators?
45. Priority of operators?
46. What is 17%7 ?
47. What is & operator?
48. Identifier?
49. Tourbo C?
50. features of C language
51. auto variables?

52. Who developed C programming language
       Ans: Dennis Ritchie

53. What is | ?
      Ans: bit-wise OR operator

54. What is identifiers?

55. What is macro-expansion in C?
      Ans: #define xyz 7, here all occurrence of xyz in the program gets replaced with 7.

56. Explain the working of  -
     for(;;)
     {
      printf("Hello\n"):
      }
     Ans: repeats infinitely

57. Write syntax of switch statement?

58. What is a conditional operator?
      Ans:  ?:
     Ex: exp1?exp2:exp3;
     here if exp1 is True, exp2 is executed else exp3 is executed.

59. Name three string handling functions?
      Ans: strlen(), strrev(), strcpy();

60. What is strcmp() function?
      Ans: compares to strings.

61. What is getch() function?
      Ans: this is a input function for reading a character

62. Explain the behavior of loop shown below
     while(1)
     {
      printf("Good Morning\n");
      }
    Ans: this is an infinite loop

63. what is sizeof()?
      Ans: this returns the number of bytes the operand occupies

64. What is strcat()?
      Ans: appends two strings. For ex: strcat(s1,s2), appends s2 to s1.

65. What is the size of long int variable?
      Ans: 4 bytes.

66. What is the size of double variable?
      Ans: 8 bytes.

67. What is signed and unsigned integer?
      Ans: by default is signed and using the keyword unsigned positive range can be declared.

68. What will strcmp("ROM","RAM"); return?
      Ans: returns a positive value as ROM is alphabetically above RAM.

69. What is the size of long double variable?
      Ans: 10 bytes.

70. What is meaning of opening braces and closing braces when used in a program?
      Ans: This demarcates a block of statements.

71. Where is clrscr() function included?
      Ans: In header file conio.h

72. What should be first statement in a typical C program?
      Ans: variable declaration statement.

73. What will happen if a variable is declared outside the main()?
      Ans: the variable become accessible to all functions

74. What will happen if break statement is not used at end of a case in switch statement?
      Ans: the control will be proceed to next case

75. What is the size of variable A in the declaration, int A[2][3]?
      Ans: 12B

76. What is keyword in C?
      Keywords are the reserved words.
      Ex: int x; // here int is a keyword and x is a integer variable.

77. What are identifiers?
      Identifiers are names given for entities in program such as, variables, functions, arrays etc.

78. What is prototypes in C?
      Function prototypes are used to specify data types of the arguments in parameter list.

79. Who developed C?
      Dennis Ritche

101.

No comments:

Post a Comment