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
- What do you understand by a constant and a variable in C-language? Explain with a suitable example.
- Write the output of the following C-program. 3 #include<stdio.h> main() int m,n, p=5; m=p++; n=++p; printf("m=
- Write the following expression in C : 3 e x 3 + 2 cos x + ln |1 + sin x| + 2 sin 2 x
- Distinguish between the user-defined function and standard built-in function.
- Write the syntax of for-loop and explain it with suitable example.
- Compare between primary and secondary memory.
- What is an one-dimensional array? Give an example.
- 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.
- 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].
- 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.
- What is meant by an operator in C-program? Explain the function of logical AND operator.
- Using logical AND and logical OR operators, write a C-program to test whether a given year is a leap year or not.
- Write three differences between a Compiler and an Assembler.
- Write a C-program to find the maximum element of a given array.
- Write a C-program to print the following pattern : * ** *** ****
- What is a header file in C? Write a short note on any one of the header files.
- What is a keyword in C? Mention any four key words.
- Write a C-program to find the transpose of the matrix 1 2 3 4 5 7 .
- 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 .
- 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 .
- Write a C-program to evaluate the sum of two matrices of same order.
- 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 .
- Write a C-program to solve a system of two linear equations in two unknowns x and y .
- Write a C-program to find the AM, GM, HM of 3, 8.3, 8.8, 5, 3.1, 2, 6.6 .