0% found this document useful (0 votes)
13 views2 pages

CSF101 - Set 1 (Programming For Problem Solving)

The document is an examination paper for the B.Tech (1st Year) course on Programming for Problem Solving at DIT University, Dehradun. It includes various questions covering topics such as software types, algorithms, C programming concepts, loops, structures, and file handling. Students are required to attempt all parts of the questions within a 3-hour time frame.

Uploaded by

skill73557
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views2 pages

CSF101 - Set 1 (Programming For Problem Solving)

The document is an examination paper for the B.Tech (1st Year) course on Programming for Problem Solving at DIT University, Dehradun. It includes various questions covering topics such as software types, algorithms, C programming concepts, loops, structures, and file handling. Students are required to attempt all parts of the questions within a 3-hour time frame.

Uploaded by

skill73557
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Paper Code: CSF101 Printed Page 1 of 2

DIT UNIVERSITY DEHRADUN


st
B.TECH (1 Year) END TERM EXAMINATION, ODD SEM 2020-21 (SEM I)
Roll No.
Subject Name: Programming for Problem Solving
Time: 3 Hours Total Marks: 1
Note: All questions are compulsory. No student is allowed to leave the examination hall before the completion of the exam.
______________________________________________________________________________________________________
Q.1) Attempt all Parts :
(a) Explain the differences between system software and application software. According to you, compiler
belong to which type of software and why?
(b) Write an algorithm or draw a flowchart to compute simple interest by getting the inputs as amount, rate of
interest and time in years.

(c) Explain the following terms with suitable example with respect to C language:
1- Identifier
2- Keyword
3- Formatted output function
(d) Write a C program to sort the elements of an integer array in descending order using any sorting technique.

[4 x 5= 20

Q.2) Attempt all Parts :


(a) Write short notes on the following with proper syntax, example, and explanation.

I. User-defined Function
II. Function Prototype

(b) Explain any two kinds of loops with example in C language.


(c) Convert the following as indicated in the brackets:
I- (234)8= ( …….)16
II- (101011)2 = ( ……..)10
(d) How structure is different from a normal variable? How much memory will be allocated for variable b1 in
following case? Assume int takes 2 bytes, float takes 4 bytes and char takes 1 byte.
struct book{
char name[25];
int pages;
float price;
char author_name[50];
}b1;
[4 x 5= 20

Q.3) Attempt any Two Parts :


(a) Electricity Bill Statement (EBS) takes units consumed from consumer and calculation of electricity charges (EC
is done using provided criteria:
I – 100 units @ Rs. 2.00/- (per unit)
II- 101 – 200 units @ Rs. 3.50/- (per unit)
III- 201 and more units @ Rs. 4.50/- (per unit)
General sale tax which is the 10% of the EC. Amount due (EC + Gen. Sale tax)
Write a C program that calculates and prints the final bill amount to be paid by consumer.
(b) What is the difference between call by value and call by reference function? Write a program to swap tw
numbers using a call by reference function and print the swapping results in main function. Is it possible t
write this program using call by value? If not, explain why?
(c) Write the names any three sting functions by explaining their working in C. Write a C program that converts
Paper Code: CSF101 Printed Page 2 of 2

uppercase alphabets into lowercase alphabets of a string without using strlwr ( ) function.
[2 x 10= 20

Q.4) Attempt any Two Parts :


(a) Answer following:
I. Differentiate between a structure and an array with suitable example.
II. Is it possible to create an array of structure? Explain with the help of an example.

(b) Explain the structure of switch –case-default statement in C. Write a C Program to test whether a give
number n is even or odd using switch case statements.
(c) Create a structure to specify data of customer in a bank. The data is to be stored is: account number, name,
and balance. Assume maximum of 200 customers in the bank. Write a C program to perform the following
tasks.
I- Print the account number and name of each customer with balance below Rs 100.
II- Print the name of those customers whose account number is even.
[2 x 10= 20

Q.5) Attempt any Two Parts :


(a) Write a C Program to sort the n number of strings into alphabetic order.
(b) Draw the block diagram of a CPU and explain each components in detail.
(c) Discuss various file opening modes in detail. Write a C program to read a file and display its contents.
[2 x 10= 20
-----END OF PAPER ----

You might also like