PYQ – PROGRAMMING WITH "C" (2418101) | SEMESTER 1ST AND 2ND (1ST YEAR) | Year 2020
Programmimg with "C" 2020 (OLD) PYQ.

Group A
Choose the most suitable answer from the following options: - (1*20=20)
(i) The FILE structure is defined in which of the following files:
(a) stdlib.h
(b) stdio.c
(c) io.h
(d) stdio.h
(ii) Which of the following can a format string of printf () function
contain:
(a) Characters, format specifications and escape sequences
(b) Character, integer, and floats
(c) Strings, integers, and escape sequences
(d) Inverted commas, percentage sign and backslash character
(iii) Given the statement,
Maruti.engine.bolts = 25;
Which of the following is true?
(a) Structure bolts is nested within structure engine.
(b) Structure engine is nested within structure engine.
(c) Structure Maruti is nested within structure engine.
(d) Structure Maruti is nested within structure bolts.
(iv) Struct time {
int hours;
int minutes;
int seconds;
} t;
Struct time *pt;
Pt = &t;
With reference to the above declarations, which of the following refers to seconds correctly?
(a) pt.seconds
(b) pt -> seconds
(c) time.seconds
(d) time-> seconds
(v) if int S[5] is a one – dimensional array of integers, which of the
following refers to the third element in the array?
(a) *(S + 2)
(b) *(S + 3)
(c) S + 3
(d) S + 2
(vi) Which you pass an array as an argument to a function, what actually
gets passed?
(a) Address of the array
(b) Values of the array
(c) Address of the elements of the array
(d) Number of elements of the array
(vii) An array is a collection of:
(a) Different data types scattered through memory.
(b) The same data type placed next to each other in the memory.
(c) The same data type scattered through memory.
(d) Different data types placed next to each other in memory.
(viii) What is the different between the 5’s in these two expressions?
int num [5];
num [5] = 11;
Select the correct answer.
(a) First is particular element, second is type
(b) First is array size, second is particular element.
(c) First is particular elements, second is array size
(d) Both specify array size.
(ix) What will happen if you assign a value to an element of an array
whose subscript exceeds the size of the array?
(a) The element will be set to 0.
(b) Nothing its done all the time
(c) Other data may be overwritten
(d) Error message from the compiler
(x) A preprocessor directive is:
(a) A message from compiler to the programmer
(b) A message from compiler to the linker
(c) A message from programmer to the preprocessor
(d) A message from programmer to the microprocessor
(xi) A header file is:
(a) A file that contains standard library functions
(b) A file that contains definitions and macros
(c) A file that contains user defined functions
(d) A file that is present in current working directory
(xii) A do-while loop is useful when we want that the statements within
the loop must be executed:
(a) Only once
(b) At least once
(c) More than once
(d) None of the above
(xiii) In what sequence the initialization, testing and execution of body is
done in a do-while loop?
(a) Initialization, execution of body testing
(b) Execution of body, initializing, testing
(c) Initialization, testing, execution of body
(d) None of the above
(xiv) An expression contains relational operators, assignment operators and
arithmetic operators. In the absence of parenthesis, they will be evaluated in
which of the following order.
(a) Assignment, relational, arithmetic
(b) Arithmetic, relational, assignment
(c) Relational, arithmetic, assignment
(d) Assignment, arithmetic, relational
(xv) Which of the following statement is used to take the control to the
beginning of the loop?
(a) Exit
(b) Continue
(c) Break
(d) None of the above
(xvi) Which of the following is odd one out?
(a) +
(b) -
(c) /
(d) **
(xvii) In C, Arithmetic instruction cannot contain
(a) Variables
(b) Constants
(c) Variables name on right side of =
(d) Constant on left side of =
(xviii) Hierarchy decides with operator
(a) is most important
(b) is used first
(c) is fastest
(d) Operated on largest numbers
(xix) Which of the following is false in C?
(a) Keywords can be used a variable name
(b) Variable name can contain digit
(c) Variable name does not contain a blank space
(d) Capital letters can be used in variable name
(xx) The expression X = 4 + 2 % -8 evaluates to
(a) -6
(b) 6
(c) 4
(d) None of the above
Group:-"B"
➥ Answer all Five Questions: - (5*4=20)
2. How pointers differ from variables in C? Explain
OR
What is indirection operator and what is its role?
3. Mention the advantages of structure type over union type with suitable example.
OR
What is the relationship between a member and a structure?
4. What is a computer program?
OR
What is a text editor?
5. Write the algorithm and draw the flowchart to find the average of 5 numbers.
OR
What are the library functions? Mention any four library functions in C.
6. Explain with examples the syntax of scanf () amd printf () functions.
OR
What is Pointer? Explain with the help of examples.
Group:- "C"
➥ Answer all Five Questions: - (5*6=30)
7. Write a C Program to add M * N matrices and store results in the third matrix. The value of M and N are given by user.
OR
Define the following terms:
a. Source program
b. Object program
c. Executable program
8. Write a C program to compute Fibonacci series up to five terms.
OR
Write a C program to find the roots of quadratic equation ax2 + bx + c = 0 for all possible combination of a, b, c.
9. Define a structure with the following three numbers:
Roll numbers, name and total marks of student.
Write a C program to read and display the details of student.
OR
What do you mean by machine language? How it differs from high-level language? What are the advantages of high-level language?
10. Write the algorithm and draw the flow chart to convert the temperature in Degree F to Degree C using formula Degree C = {5 * (F- 32)} / 9
OR
Define function. Explain prototype of function.
11. Explain the following terms:
a. Break
b. Continue
c. Exit
OR
Write down the general syntax of switch statement and explain with the help of example.
*****
Thank you for visiting us, Hope you like our content
and its really helpful for you.
Do follow us for regular updates and if you want any specific help feel free to
ask on below.
Web Site: https://diplomaincs.in/
Contact Us: https://diplomaincs.in/contact-us
Follow us on below social handle:-
LinkedIn: https://www.linkedin.com/in/computer-scinece-and-engineering-diploma-b5917b3a1/
What’s App: https://whatsapp.com/channel/0029VaGwTZU1t90j9c1bKl0g
Facebook: https://www.facebook.com/Diploma.1234
PYQ Video References
No references available right now.
Comments & Reviews
Loading comments...