CU SEC-A-1 C Programming Language, 2020

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

Open this paper in MathQP

  1. Select the valid numeric constant.
  2. The output of the following program is int x=10; int main() int x=0; printf(" return 0;
  3. What will be the output of the following C code? #include<stdio.h> void main() int x, y=5,z=5; x=y==z; printf("
  4. Which one of the following operators is used for decision making in C?
  5. How many times will the following loop execute? for (j=1; j<=10; j=j-1)
  6. What does this statement mean? texttt x - = y + 1
  7. What will be the output after execution of the following statements? main() printf(" n ab"); printf(" b si"); printf(" r ha");
  8. Which of the following is true about the return type functions in C?
  9. In which order the following gets evaluated? (A) Arithmetic (B) Assignment (C) Logical (D) Relational
  10. Find the output of the following C-code : # include <stdio.h> int main() int C=1; int S=0; while((C>0) (C<60)) S=S+C; C++; printf("
  11. What is meant by a variable in C language? Explain with a suitable example.
  12. State the conditions that a variable name in C must satisfy.
  13. What is the general form of exponential notation for a real constant? Explain the terms used in the general form with a suitable example.
  14. What is meant by an operator in C? Explain the functions of logical AND and logical OR operators.
  15. Draw the flowchart for the following program segment : ..... ..... if (category = A) marks = marks+bonus marks; printf(" ...... ......
  16. What is recursion? Write a function to evaluate factorial of n to show how the recursion works.
  17. What are the necessary header files to be included in the following program to get the proper output? Justify your answer. void main() int number, i; sum=0; printf(" n enter the number"); scanf(" for (i=1; i<=number; i++) sum=sum+(1/pow(i,2)); if (i==1) printf(" n 1+"); else if (i==number) printf("1/( else printf("1/(
  18. State the advantages of Library functions.
  19. Can you recognize the series which is mentioned in the above program?
  20. What are the main data types in C? Write short notes on any two of them.
  21. Write a C program to display the following output : (using nested for loop) * * * * * * * * * * * * * * *
  22. Write a short note on Branching statements in C.
  23. Write a C program to add two matrices and print the resultant matrix.
  24. What is the objective of the texttt main() function in C? What is the purpose of texttt printf() and texttt scanf() in C program?
  25. How is a function declared in C Language?
  26. Write a program to swap two numbers without using the third variable.
  27. What are the advantages of using C language over other programming languages? What are some of the limitations of C language?
  28. Write a C program to check whether a given number is prime or not.
  29. State the differences between the declaration of a variable and the definition of a symbolic name.
  30. Write the valid C-expressions : (A) e x 3 + 2 cos x + log |x 5 + 1| qquad (B) tan (x 3 + 1) + frac 1 cos x + sec x
  31. Let x = 2020, y = 2021, z = 2022 . Write a C-program to rotate their values such that x has the value y , y has the value z and z has the value x .
  32. Write the syntax of texttt for-loop and explain it.
  33. Using texttt for-loop , write a program in C to find first 50 Fibonacci numbers.
  34. What is texttt do-while statement? Explain with suitable example.
  35. Describe the two ways of passing parameters to functions. When do you prefer to use each of them?
  36. Write a program that use a function to sort an array of integers.
  37. What is the output of the following C-code? #include<stdio.h> main() int x, y; y=6; x=y<<6; printf("
  38. Distinguish between function texttt Call by value with texttt Call by Address .
  39. Write a C-program to find sum of first n odd positive integers and to illustrate texttt Call by value .