Additional C
Additional C
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.
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