Question: SET A Assignment 2 1 . Write a C program that involves finding and summing the odd numbers in an array. Declare an array of

SET A
Assignment 2
1.Write a C program that involves finding and summing the odd numbers in an array. Declare an array of integers and create a function, sumOddNumbers, to iterate through the array, identify odd numbers, and calculate their sum. The main function should then print the original array and the sum of the odd numbers.
Original array : 2468101214
Sum of odd numbers: 0
Original array : 12345678910
Sum of odd numbers:25
2. Let A and B are two unsorted arrays. Write a program to find the median of the elements of the arrays
3. A file contains n student records. Each record contains Student Name, Number and Marks of three Subjects. Write a C program to read each record and find the result, average and total. If the student has passed, the record is to be written into a file Passed and if student has failed , write the record into another file named Failed
4. A data base contains lot of multiple invoice bills. The information that are available in the invoice bill is Customer Name, Customer Id , Data of Purchasing, Amount of Purchasing and bill number. Write a C program to display the detail of a bill in the prescribed format if the bill number is given as the input using the random accessing method
(Note:- Database is maintained in the form of files)
5. Take the price and quantity of items as an input. Write a C program to calculate the sum of the prices. Write another C function to calculate the discount according to the following rules: For total less than Rs.1000, discount is 5%. For total greater than Rs.1000 but less than Rs.5000, discount is 10%. For total greater than Rs.5000, discount is 15%. Write another function to print the individual item prices, total, discount and the final price.
Example: If the prices are as follows:
Item 1: 200
Item 2: 400
Item 3: 200
Item 4: 10
Item 5: 50
And the quantities are:
Item 1: 1
Item 2: 1
Item 3: 3
Item 4: 5
Item 5: 2
Then you should print:
Item Price Quantity Subtotal
Item 12001200
Item 24001400
Item 32003600
Item 410550
Item 5502100
------------------------------------------------- TOTAL 1350 Discount 10%-135------------------------------------------------- GRAND TOTAL 1215
6. Write a C program to create a structure box with required dimensions.Create two boxes with different dimensions and write the box data to a file named Box. Read the data from the Box file, calculate the volume of the box, and write the data to a file called BoxData.
7. Write a C program to create a structure called person with name, email-id, and age.Write the person data in a file called Person.Write all the persons data whose age is greater than 60 to a file named Senior-Citizens. Write all the other persons details in a file called Citizen.
8. Write a C program that takes a string as input from the user. Write all the alphabets into a file alphabets, special characters in a file special and digits in a file digits. Read the contents of the 3 files and display them in a neat format.
9.Write a program to take the following strings in two dimensional array and print them in sorting order and take any name and find whether the name exists in the array or not.
Strings: {"HARITHA","CHANDANA","JYOTHI","HARIKA"};
SET A Assignment 2 1 . Write a C program that

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!