0% found this document useful (0 votes)
11 views1 page

Additional C

Uploaded by

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

Additional C

Uploaded by

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

Additional C-Programs that have been covered during the lab sessions and to be written in the

LAB COPY are stated below.


1. Write C-Programs to show the operations of SWITCH-CASE for the following.
a) Design a Calculator to show the major mathematical operations on two variables (1-
Addition, 2- Subtraction, 3-Multiplication, 4-Division, 5-Modulo Operations, 6- Square
and the default with a message “Wrong Choice”).
b) Design a Menu of a Restaurant showing the BREAKFAST and LUNCH Items. Based on
the choice of the customer, the bills need to be generated. The program should have
provision for multiple items choosing. The final bill should display all the items with a bill.

2. Write C-Programs to show the operations of FUNCTIONS using Call-by-Value and Call-by-
Reference for the following situations.
a) Accept two number from the user in main function. Pass these numbers to a function called
the CALCULATE_SUM for finding the sum of these numbers.
b) Accept five numbers from the user in the main function and send them to a function
FIND_AVG to get the average number.
c) Generate a natural number between 1 and 100 inside the main function and send it to a
function GET_SUM to find the sum of all the natural numbers up to the given number.
(E.g. use sum=n (n+1)/2).

3. Write C-programs for the following by using the SWITCH-CASE control structure for
performing the given operations.
a) Initialize an array of 10-integer numbers. Accept inputs from the user and store them in the
array (CASE-1).
b) Display the Array elements with their array positions (CASE-2)
c) Find the sum and average of the array elements (CASE-3)
d) Fins the largest and smallest elements in the array (CASE-4)
e) Find the number at a certain position of the array (CASE-5)
f) Find the numbers in the array which are divisible by another user-defined number (CASE-
6)
g) Find the sum of the array elements at position X and Y defined by the user (CASE-7).
h) DEFAULT: Check if Array is empty. If so, display a message.

4. Write C-programs for the matrix operations (i.e. 2-D Arrays) –


a) ADDITION of corresponding elements of the matrices
b) SUBTRACTION of corresponding elements of 2nd matrix from the 1st matrix.
c) MULTIPLICATION of the two given matrices if the matrix operation for multiplications
holds fit (i.e. rows and column count matches) in the matrices.

5. Describe the operations of STRUCT in C with the help of the following given situations.
a) Create Bank Accounts for Two persons with the NAME, ACC_NO, and MIN_BALANCE.
Take the STRUCT instances as Person_1 and Person_2.
b) Describe 4-wheeler Vehicle Details based on the candidate Type in the STRUCT. Take the
variables VEH_NAME, VEH_TYPE, VEH_DETAILS. Define only three instances VEH-
1, 2 & 3.

All questions with their corresponding outputs to be written in the copy and submitted.
Submission (Date without Fail) - 06/01/2025

You might also like