ETE_ 54506QP

Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

PRINTED PAGES : 2

Paper ID: 15994 Roll No..............................

END-SEMESTER EXAMINATION, 2023-24


B. Sc. (Hons.) / B. Tech. (SEMESTER : 01)
CSE 113 : PROGRAMMING FOR PROBLEM SOLVING
Time: 3 Hrs. Max. Marks: 100
Note: 1. All questions are compulsory.
2. Assume missing data suitably, if any.
CO1: Demonstrate the algorithm, Pseudocode and flowchart for the given problem.
CO2: Develop better understanding of basic concepts of C programming
CO3: Create and Implement logic using Array and Functions
CO4: Construct and implement the logic based on the concept if strings and pointers
CO5: Apply user-defined data types and I/o operations in file
CO6: Design and develop solution to real world problems in C.
COS Marks BTL

SECTION-A
All Questions are Compulsory: (10×4=40 Marks)
1. How do you define the steps involved in solving a particular problem using CO1 4 K1
an algorithm? Give one example.
2. Illustrate using flowchart to find average of any 5 numbers. CO1 4 K2
3. How implicit casting is different from explicit data casting? CO2 4 K1
4. What is use of ternary operator? Illustrate with an example. CO2 4 K2
5. "In an array elements are stored at continuous memory locations", comment CO3 4 K2
on it and summarize your comment.
6. Apply the call by reference method and show the swapping of two numbers. CO3 4 K3
7. Illustrate the declaration of the pointer variable. CO4 4 K2
8. Select any 2 string manipulation functions and explain using their syntax. (a) CO4 4 K3
Copy, (b) Reverse, (c) Concatinate, (d) Compare.
9. Explain the difference between structure and union. CO5 4 K2
10. Develop a program to store and print the roll no., name, age, address and CO5 4 K3
marks of students using structure.
f

SECTION-B
All Questions are Compulsory: (3×6=18 Marks)
11. (a) List and compare atleast 2 ways to return multiple values from a function CO3 6 K4
in C.
--- OR ---
(b) Simplify a C program to sort a list of elements using the bubble sort
algorithm.
12. (a) Analyse the algorithm of palindrome and write the code to find that CO4 6 K4
entered string is palindrome or not.
--- OR ---

1 Contd…..
(b) Write a function that reads a string using pointers and counts the number
of vowels and consonants in it.
13. (a) List the types of files and write a program to demonstrate the fprintf(), CO5 6 K4
fscanf() functions.
--- OR ---
(b) Analyse the difference between a sequential file and a random file?

SECTION-C
All Questions are Compulsory: (3×10=30 Marks)
14. (a) Inspect and write the code of binary search and draw the flowchart as well. CO3 10 K4/K5
--- OR ---
(b) Compare linear search and binary search algorithms. Explain a C program
to find the position of a target value within an array using linear search.
15. (a) Write a program to accept a string, oldword and newword form a user. CO4 10 K4/K5
and replace the oldword in the string with the newword. Judge the
performance of this solution.
--- OR ---
(b) Compare the array and pointer and write the program using pointers to
compute the sum and mean of all elements stored in an array of n real
numbers.
16. (a) Create a structure for storing details of an employee, choose the details CO5 10 K4/K5
yourself. Accept 5 such details from a user and store it in a file.
--- OR ---
(b) Estimate a program in C to find the content of a file and the number of
lines in a text file.
Test Data:
Input the filename to be opened : test.txt
Expected Output :
The content of the file test.txt are:
test line 1
test line 2
test line 3
test line 4
The lines in the file are : 4

SECTION-D
Attempt the following Question: (1×12=12 Marks)
17. (a) Through command line accept a file name and a word. Build a solution to CO6 12 K5/K6
find the number of occurrences of that word in the file.
--- OR ---
(b) How do you determine initialization of a structure? Explain the
importance of assign and access structure members.

*******

2 Contd…..

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy