PYQ – PROGRAMMING WITH "C" (2418101) | SEMESTER 1ST AND 2ND (1ST YEAR) | Year 2024
Programming with "C" 2024 (NEW) PYQ.

Group A
Choose the most suitable answer from the following options: - (1*20=20)
(i) Type def can used with which of these data types?
(a) struct
(b) union
(c) enum
(d) all of these
(ii) A union member variable is generally accessed using the :-
(a) address operator
(b) dot operator
(c) comma operator
(d) ternary operator
(iii) A structure can be placed within another structure and is known as
:-
(a) Self - referential structure
(b) nested structure
(c) parallel structure
(d) pointer to structure
(iv) While declaring pointer variables, which operator do we use?
(a) address
(b) arrow
(c) indirection
(d) dot
(v) For dynamically allocated variables, memory is allocated from which
memory area?
(a) Stack
(b) Heap
(c) Global
(d) BSS
(vi) The default storage class of global variable is
(a) auto
(b) static
(c) register
(d) extern
(vii) The function that is invoked is known as :-
(a) Calling function
(b) Caller function
(c) Called function
(d) Invoking function
(viii) Function declaration statement identifies a function with its
(a) name
(b) arguments
(c) data type of return value
(d) all of these
(ix) A statement block consists of how many statements?
(a) 0
(b) n
(c) 1
(d) None of these
(x) The default label can be placed at which position in the switch
statement?
(a) beginning
(b) end
(c) middle
(d) anywhere
(xi) Which operator can not be used with float operands?
(a) %
(b) _
(c) +
(d) *
(xii) Which operator has the lowest precedence?
(a) Size of
(b) Unary
(c) Assignment
(d) Comma
(xiii) What is the symbol used for conditional operator?
(a) *
(b) ? :
(c) /
(d) = =
(xiv) A character array always ends with______
(a) Question mark (?)
(b) full (.)
(c) null (‘\0’) character
(d) all of above
(xv) Which of the following is the symbol for Bit wise AND operator?
(a) ! ;
(b) &
(c) &&
(d) ! =
(xvi) Printf() and scanf() are defined in which header file?
(a) stdio.h
(b) conio.h
(c) string.h
(d) math.h
(xvii) Which of the following is C – Compiler?
(a) Turbo c++
(b) Borland c
(c) Both (a) & (b)
(d) JDK
(xviii) The format string of character data type is :-
(a) % d
(b) % f
(c) % c
(d) % e
(xix)
(a) One dimensional
(b) Tow dimensional
(c) Three dimensional
(d) Four dimensional
(xx) A variable which holds the address of another variable is known as
_________
(a) Array
(b) function
(c) Pointer
(d) Structure
Group:-"B"
➥ Answer all Five Questions: - (5*4=20)
2. Draw the flowchart to find the sum of natural numbers up to N.
OR
What is an algorithm?
3. What is a variable? How are the variables declared in C?
OR
Explain the program structure of C language.
4. Explain ternary operator.
OR
Discuss increment and decrement operators available in C and the rules associated with them.
5. Write a program to display the ASCII value of a given character.
OR
Write a C program to swap (exchange) values of two variables A and B.
6. Explain various character input/output function in C.
OR
Write a C program to find the value of y using the relation y = x2 + 2x – 1.
Group:- "C"
➥ Answer all Five Questions: - (5*6=30)
7. Write a C program to find the value of A using A (i, j) =
1 + i (when J =1)
1 + i/j (when J = 2)
1 + iJ (when J = 3)
1 + i * J (when J > 3 or J < 1)
OR
Write a C program to solve the series: S = x –x3/3! + x5 /5! - x7/7! . . . xn /n!
Which is the summation of sine and x is expressed in radians.
8. Write a C program to
print a pyramid of digits as shown below for n number of lines.
|
|
|
|
1 |
|
|
|
|
|
|
2 |
3 |
2 |
|
|
|
|
2 |
3 |
4 |
3 |
2 |
|
|
2 |
3 |
4 |
5 |
4 |
3 |
2 |
OR
Explain the importance of a switch case statement. In which situations is a switch case desirable? Alos give its limitations.
9. Write a C program to sort a set of n numbers in ascending order and explain the algorithm used.
OR
Write a C program to sort a set of n numbers in ascending order and explain the algorithm used .
10. Define a structure with the following three members: name and total marks of a student. Write a C program to read and display the details of a student.
OR
Explain a union with members integer, string and float and illustrate the use of the union.
11. Define a union with members integer, string and float and illustrate the use of the union.
OR
What do you understand by identifiers and keyboards?
*****
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...