Assignment-1CS101

CS101                                      Assignment-1                               2010-2011

 

PROGRAMMING IN C

 

                                                                                                                  2 Marks Questions

 

1.      What is the difference between algorithm and flow chart?

2.      Why computer languages used for problem solving?

3.      What do you mean by problem solving?

4.      What is top down and bottom up programming?

5.      Write short note on modular programming.

6.      What is structured programming?

7.      What is programming paradigm?

8.      What is procedural programming?

9.      Write various symbols used in flow chart.

10.  What is a computer program?

11.  What do you mean by identifier?

12.  What are tokens in c language?

13.  What are constants in c language?

14.  What are reserve words in c language?

15.  What are variables? Write the rules for naming a variable.

16.  What do you mean by type casting?

17.  What do you mean by operator precedence and associativity?

18.  What is the need of declaring variable in c language?

19.  What is the difference between a++ and ++a?

20.  What is the difference between ‘a’ and “a”?

21.  Differentiate between the arguments within the scanf () function & the printf () Function.

22.  Differentiate between printf () and puts ().

23.  Differentiate between getche () and getch ()

24.  Differentiate between scanf () and gets ()

25.  What do you mean by escape sequences?

26.  What do you mean by flags?

27.  What is the function of clrscr ()?

28.  What are preprocessor directives? Name two preprocessor directives.

29.  What do you mean by control flow statements?

30.  What is the difference between switch and if else statements in C?

31.  What is the use of continue and break statements?

32.  Differentiate between for and while loop.

33.  Differentiate between a legal and an illegal nested loop.

34.  Differentiate return and exit ().

35.  What do you mean by array?

36.  Define a multidimensional array.

37.  Give syntax of one dimensional array.

38.  Explain the significance of subscript in an array?

39.  List all the input and output functions of an array.

40.  What are different ways to initialize a two dimensional array? Give Example.

41.  What are string variables?

42.  What are character string input and output functions?

43.  How does strcmp () function in different cases in terms of the value returned.

44.  What is the purpose of strcat () function?

45.  What is the purpose of strcpy() function?

46.  What is the purpose of strlen() function?

47.  What is the purpose of string.h in C?

48.  What are user defined functions in C?

49.  What is function Prototype?

50.  Differentiate between a function prototype and a function definition.

51.  What are internal and external variables?

52.  What do you mean by command line arguments?

53.  What is recursion?

54.  What are the uses of functions?

55.  What is significance of calloc(), malloc () and realloc() function in C?

56.  What are the advantages and disadvantages of recursion?

57.  What is the difference between actual arguments and formal arguments?

58.  Give two different examples of a union declaration.

59.  Differentiate between the union declaration and structure declaration?

60.  What is the use of structure in C Language?

61.  What is the function of dot operator?

62.  What do you mean by enumeration?

63.  What do you mean by unions?

64.  State limitations of union.

65.  Define a pointer variable. How will you declare it?

66.  What do you mean by dynamic memory allocation?

67.  What do you mean by array of pointers?

68.  Can a pointer variable appear on the left side of an assignment operator?

69.  What are advantages of pointers?

70.  Differentiate between compilers and interpreters.

71.  What do you understand by pseudo codes?

72.  Differentiate between functions and statements in C language.

73.  What are different data types in C?

74.  Define variable.

75.  What are derived data types or user defined data types?

76.  Define constants in C language.

77.  What do you mean by operator precedence?

78.  What are unary operators?

79.  What do you mean by escape sequences?

80.  Define expressions in C.

81.  What do you mean by type conversion in expressions?

82.  What is the output of following  fragment :

X = 5;

Y =X++;

printf (“%d%d”, x,y);

83.  Why do we use header files?

84.  Write evolution of ‘C’ programming language.

85.  What are control statements in C language?

86.  Why do you use control statements?

87.  Write syntax of break statement.

88.  What is the significance of ternary operators?

89.  What is the use of continue statements?

90.List the advantages of arrays.

91.Define one dimensional array.

92.Define Multidimensional array.

93.What are character arrays?

94.What is array overflow?

95.What are string variables?

96.How arrays are initialized in C?

97.  Write some advantages of functions?

98.  How you can call the functions?

99.  What is the use of return statement?

100.          What are static variables?

101.          Define register variable.

102.          What are command line arguments?

103.          Define recursion.

104.          What are pre-processor directives?

105.          What is the use of header files?

106.          Define file inclusion.

107.          What are pointer variables?

108.          What is dynamic memory allocation?

109.          What is pointer to pointers?

110.          What are pointers and functions?

111.          Define Structure.

112.          How you can declare a structure?

113.          Define unions.

114.          What is structure within structure?

115.          What is enumeration?

116.          What is a file?

117.          How you can open and close a file?

118.          What are the types of errors during input/output operations on a file?

119.          What is the difference between sequential file and random access file?

120.           

                                           5 Marks Question

  1. Write the algorithm and draw the flow chart to find roots of a quadratic equation.      
  2. List and explain various good qualities of an algorithm.
  3. How flow chart is related to algorithm? Write an algorithm and draw a flow chart for checking whether a number is prime or not.
  4. List and describe various steps of Problem Solving briefly.
  5. What are the different types of operators available in c language? Explain.
  6. Discuss the basic data types in C.
  7. Write short notes on:
  8. Shorthand assignment operators (b) Bitwise operators
  9. What is the various unformatted and formatted input function available in c? Explain them with example.
  10. What are stdin, stdout and stderr? Explain.
  11. How comments in C program are given? Explain with an example. What is the purpose of comments?
  12. What do you mean by loop? Explain the concept of looping in C.
  13. Write a program to print the first 10 terms of Fibonacci series .
  14. Give syntax of break statement. What is its significance? What the difference is between continue statement and break statement?
  15. Compare all the three loops available in C.
  16. Differentiate between passing one dimensional array and two dimensional arrays in specification of function prototype and function definitions           .                      
  17. Write a program to calculate the total number of elements of a multidimensional               array?
  18. Write a program to multiply two 2-D arrays.
  19. Write a program in C to sort in ascending order integer elements of one-dimensional array.
  20. Write a function rev digit to reverse the digits of a long number without using character array (e.g. 54662 = 26645)
  21. Write a function trace to sum the diagonal elements of a square matrix.            
  22. Write a program in C to find whether the string is palindrome or not.
  23. Explain briefly various string operations which can be performed using built-in functions in C.
  24. Write a program to reverse a string making use of strlen() function.
  25. What are functions? Compare call by value and call by reference with the help of program.
  26. Compare recursion with iteration.
  27. Write a program which pass functions as arguments to other functions.
  28. Explain the usefulness of structures and Unions in C.
  29. What do you mean by Structure? How it can be declared and initialized in C?
  30. What do you mean by Unions? How it can be declared and initialized in C?
  31. Differentiate the following :
  32. (a)Arrays and Structures (b) Local and Global Structure
  33. Write short notes on:
  34. Internal storage of Unions (b) Structure with in Structure          
  35. What is the difference between an array of pointers to objects and pointers to arrays of objects?
  36. Explain with the help of examples pointer arithmetic.
  37. Explain with example the relationship of one dimensional array with pointers.
  38. Explain by giving suitable example pointers with structures.
  39. Differentiate the following:
  40. Pointer and variable (b) value in function and address in a function
  41. Write short note on:
  42. (a) pointer  and  Functions   (b)  Pointer and structures
  43. Explain various functions for input/output operations on files.
  44. Explain the functions for random access to files.
  45. How structures are initialized? How can you access the structure members?
  46. Explain how array of structures can be passed to the functions with example.
  47. How you can pass structures to functions? Explain.
  48. Explain pointers to structures with example.
  49. How can we pass pointers to a function? Explain with example.
  50. How you can declare and initialize a pointer variable? Explain with example.
  51. Explain array of pointers.
  52. How can you pass parameters to a function?
  53. Explain recursion with the help of a C program.
  54. Explain the concept of passing array to functions with example
  55. What is a macro? Write a nested macro that gives the minimum of three values.
  56. Given an array of characters, write a program in C to reverse the array. 
  57. Explain string handling functions.
  58. Write a program in C to compute the length of a string.
  59. Explain various control statements in C.
  60. Write a C program using ‘while’ loop to reverse the digits of a given number (for example, if input number is 123, then output number is 321).
  61. Write a C program fragment using “do...while” construct to print out even numbers between 10 to 100 making sure that three numbers are written per line.
  62. Write a simple program using switch statement.
  63. Write a C program that reads a line of text and counts total number of spaces.
  64. What are operators? Explain types of operators?
  65. Explain type modifiers for different data types.
  66. Explain Console I/O functions.
Ċ
Kapil Sharma,
Nov 13, 2011, 1:19 AM
Comments