CU SEC-A-1 C Programming Language, 2021

University of Calcutta question paper, B.Sc. Honours Semester III, 2021. C Programming Language. Typed in LaTeX, searchable, with a printable PDF.

Open this paper in MathQP

  1. z = 15 (ii) z = 20 (iii) z = 0 (iv) None of these.
  2. 2.50 0.0 (ii) 2.5 0.00 (iii) 2.50 0.00 (iv) None of these.
  3. Which one is the correct way to initialize array?
  4. 46 (ii) 47 (iii) 49 (iv) 51
  5. 98 (ii) 99 (iii) 100 (iv) never
  6. Which of the following statements is true for variable names in C?
  7. Which of the following is a valid C expression?
  8. texttt stdlib.h (ii) texttt ctype.h (iii) texttt stdio.h (iv) texttt string.h
  9. What will happen if the following C code is executed? # include <stdio.h> int main() int main = 3; printf(" return 0;
  10. The values of texttt a,b,d are same in both the case.
  11. The values of texttt a,b,d are different;
  12. texttt Program 1 has syntax error, texttt Program 2 has not.
  13. texttt Program 2 has syntax error, texttt Program 1 has not.
  14. How can you use break and continue statements in for loop? Give suitable example to justify your answer.
  15. Write a C-program to test whether a number is prime or not.
  16. Write the benefits of using functions in C. Distinguish between the user-defined function and standard build-in functions.
  17. Write a C-program to find the functional values for five given values of x , where f(x) = x 2 + sin (x), quad 0 le x < 2. = 2 cos (x) - 1, quad 2 le x le 4 and input values of x are 0.2, 1.8, 2.0, 2.5, 3.5
  18. Explain conditional operator using suitable example. What are the limitations of conditional operator?
  19. Write an algorithm to find factorial of a given number. Hence write the corresponding C-program.
  20. Write down the syntax of for loop in C and draw the corresponding flow diagram.
  21. Write a C program to print a = 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 using for loop.
  22. Write a C-program to find the arithmetic mean of n real numbers.
  23. Write a C-program to find the sum of the series: 1 + frac x 1! + frac x 2 2! + cdots + cdots correct to 3 decimal places at x = 0.5.
  24. What is Mixed-mode Arithmetic? Explain with an example.
  25. Using Integer Arithmetic write a C-program to convert the given number of days into months and days and print the result.
  26. What do you mean by one dimensional array? Give an example.
  27. Using array write a C-program to sort a given set of numbers in descending order.
  28. Discuss the difference between library functions and user defined functions with suitable examples.
  29. Write a C-program to compute and print a multiplication table for numbers 1 to 5 as shown below: ||1|2|3|4|5| |1|1|2|3|4|5| |2|2|4|6|8|10| |3|3|6|9|12|15| |4|4|8|12|16|20| |5|5|10|15|20|25| using two-dimensional array.
  30. Write about the following errors in C: Syntax error; Run-time error; Logical error.
  31. Write an algorithm and draw the flow chart for finding the real roots of ax 2 + bx + c = 0 .
  32. Write down the syntax of if-else statement and draw the corresponding flow chart.
  33. Using if-else statement, write a C program to check whether the entered age is greater than or equal to 18 (years). If this condition meets then display the message, “You are eligible for voting”; however if the condition does not meet then display the message, “You are not eligible for voting”.
  34. What is local variable and global variable? Explain with suitable example.
  35. Distinguish between RAM and ROM.
  36. Write a C-program to find the sum of the digits of a number.
  37. What is meant by ‘Nesting of Functions’ in C?
  38. Is the following C-program an example of Nesting of Functions? Explain your answer logically: #include <stdio.h> int difference(int p, int q) if(p!=q) return (1); else return (0); float ratio(int x, int y, int z) if(difference(y,z)) return((x/(y-z))); else return (0.0); int main() int a, b, c; float ratio (int a, int b, int c); scanf(" printf (" return 0;
  39. What is recursion in C? Explain with an example.