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
- Select the valid numeric constant.
- The output of the following program is int x=10; int main() int x=0; printf(" return 0;
- 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("
- Which one of the following operators is used for decision making in C?
- How many times will the following loop execute? for (j=1; j<=10; j=j-1)
- What does this statement mean? texttt x - = y + 1
- What will be the output after execution of the following statements? main() printf(" n ab"); printf(" b si"); printf(" r ha");
- Which of the following is true about the return type functions in C?
- In which order the following gets evaluated? (A) Arithmetic (B) Assignment (C) Logical (D) Relational
- 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("
- What is meant by a variable in C language? Explain with a suitable example.
- State the conditions that a variable name in C must satisfy.
- What is the general form of exponential notation for a real constant? Explain the terms used in the general form with a suitable example.
- What is meant by an operator in C? Explain the functions of logical AND and logical OR operators.
- Draw the flowchart for the following program segment : ..... ..... if (category = A) marks = marks+bonus marks; printf(" ...... ......
- What is recursion? Write a function to evaluate factorial of n to show how the recursion works.
- 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/(
- State the advantages of Library functions.
- Can you recognize the series which is mentioned in the above program?
- What are the main data types in C? Write short notes on any two of them.
- Write a C program to display the following output : (using nested for loop) * * * * * * * * * * * * * * *
- Write a short note on Branching statements in C.
- Write a C program to add two matrices and print the resultant matrix.
- What is the objective of the texttt main() function in C? What is the purpose of texttt printf() and texttt scanf() in C program?
- How is a function declared in C Language?
- Write a program to swap two numbers without using the third variable.
- What are the advantages of using C language over other programming languages? What are some of the limitations of C language?
- Write a C program to check whether a given number is prime or not.
- State the differences between the declaration of a variable and the definition of a symbolic name.
- 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
- 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 .
- Write the syntax of texttt for-loop and explain it.
- Using texttt for-loop , write a program in C to find first 50 Fibonacci numbers.
- What is texttt do-while statement? Explain with suitable example.
- Describe the two ways of passing parameters to functions. When do you prefer to use each of them?
- Write a program that use a function to sort an array of integers.
- What is the output of the following C-code? #include<stdio.h> main() int x, y; y=6; x=y<<6; printf("
- Distinguish between function texttt Call by value with texttt Call by Address .
- Write a C-program to find sum of first n odd positive integers and to illustrate texttt Call by value .