CU SEC-1 C Programming Language, 2023

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

Open this paper in MathQP

  1. What do you understand by a constant and a variable in C-language? Explain with a suitable example.
  2. Write the output of the following C-program. 3 #include<stdio.h> main() int m,n, p=5; m=p++; n=++p; printf("m=
  3. Write the following expression in C : 3 e x 3 + 2 cos x + ln |1 + sin x| + 2 sin 2 x
  4. Distinguish between the user-defined function and standard built-in function.
  5. Write the syntax of for-loop and explain it with suitable example.
  6. Compare between primary and secondary memory.
  7. What is an one-dimensional array? Give an example.
  8. What is the objective of the texttt main() function in C? What is the purpose of the texttt printf() function and the texttt scanf() function? Explain with examples.
  9. Consider the following function f : [0, 4] to mathbb R : f(x) = x 3 + sin x 2, 0 le x < 2, = 2 cos x + e x 2 , 2 le x < 4. Write a program in C which will ask for a value of x in [0, 4] and will print the corresponding value of f(x) . [ mathbb R stands for the set of real numbers].
  10. Explain the difference between texttt while loop and texttt do-while loop. Write a program in C to read a non-negative integer and find its factorial.
  11. What is meant by an operator in C-program? Explain the function of logical AND operator.
  12. Using logical AND and logical OR operators, write a C-program to test whether a given year is a leap year or not.
  13. Write three differences between a Compiler and an Assembler.
  14. Write a C-program to find the maximum element of a given array.
  15. Write a C-program to print the following pattern : * ** *** ****
  16. What is a header file in C? Write a short note on any one of the header files.
  17. What is a keyword in C? Mention any four key words.
  18. Write a C-program to find the transpose of the matrix 1 2 3 4 5 7 .
  19. Write a program in C to read three numbers a, b, c and find the roots of the quadratic equation ax 2 + bx + c = 0 .
  20. Write a program in C to read a number x and find the sum : x + dfrac x 3 3 + dfrac x 5 5 + cdots + dfrac x 25 25 .
  21. Write a C-program to evaluate the sum of two matrices of same order.
  22. Using for-loop, write a C-program to print first 40 terms of the Fibonacci sequence 0 ; 1 ; 1 ; 2 ; 3 ; 5 ; 8 ; 13 ; 21 ldots .
  23. Write a C-program to solve a system of two linear equations in two unknowns x and y .
  24. Write a C-program to find the AM, GM, HM of 3, 8.3, 8.8, 5, 3.1, 2, 6.6 .