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
- z = 15 (ii) z = 20 (iii) z = 0 (iv) None of these.
- 2.50 0.0 (ii) 2.5 0.00 (iii) 2.50 0.00 (iv) None of these.
- Which one is the correct way to initialize array?
- 46 (ii) 47 (iii) 49 (iv) 51
- 98 (ii) 99 (iii) 100 (iv) never
- Which of the following statements is true for variable names in C?
- Which of the following is a valid C expression?
- texttt stdlib.h (ii) texttt ctype.h (iii) texttt stdio.h (iv) texttt string.h
- What will happen if the following C code is executed? # include <stdio.h> int main() int main = 3; printf(" return 0;
- The values of texttt a,b,d are same in both the case.
- The values of texttt a,b,d are different;
- texttt Program 1 has syntax error, texttt Program 2 has not.
- texttt Program 2 has syntax error, texttt Program 1 has not.
- How can you use break and continue statements in for loop? Give suitable example to justify your answer.
- Write a C-program to test whether a number is prime or not.
- Write the benefits of using functions in C. Distinguish between the user-defined function and standard build-in functions.
- 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
- Explain conditional operator using suitable example. What are the limitations of conditional operator?
- Write an algorithm to find factorial of a given number. Hence write the corresponding C-program.
- Write down the syntax of for loop in C and draw the corresponding flow diagram.
- Write a C program to print a = 10, 11, 12, 13, 14, 15, 16, 17, 18, 19 using for loop.
- Write a C-program to find the arithmetic mean of n real numbers.
- 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.
- What is Mixed-mode Arithmetic? Explain with an example.
- Using Integer Arithmetic write a C-program to convert the given number of days into months and days and print the result.
- What do you mean by one dimensional array? Give an example.
- Using array write a C-program to sort a given set of numbers in descending order.
- Discuss the difference between library functions and user defined functions with suitable examples.
- 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.
- Write about the following errors in C: Syntax error; Run-time error; Logical error.
- Write an algorithm and draw the flow chart for finding the real roots of ax 2 + bx + c = 0 .
- Write down the syntax of if-else statement and draw the corresponding flow chart.
- 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”.
- What is local variable and global variable? Explain with suitable example.
- Distinguish between RAM and ROM.
- Write a C-program to find the sum of the digits of a number.
- What is meant by ‘Nesting of Functions’ in C?
- 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;
- What is recursion in C? Explain with an example.