Question 1
Write a program to do the following:
Read any two matrices A and B.
Write a function to find multiplication of A and B
Save the results of this operation onto a file with name "matrix.txt"
Question 2
Read a number as input and do the following:
Write a function factorial() that takes a single argument and returns the factorial of the given number
Write a function to determine whether the given number is odd or even.
Create a binary file with name "factorial.bin" and save the results as follows:
2!
4!
5!
Question 3
Read a number as input and do the following:
Define a structure "Number" with fields as follows:
num: integer
factorial: integer
Write a program to save the results of this program into a file line-by-line.
Question 4
Read a number as input and do the following:
Write a function prime() that takes one argument and find whether the given number is prime or not.
Write a program to save the results of this program into a file
Question 5
Read a number as input and do the following:
Write a function to print the Fibonacci series up to given ‘n’ number.
Write the results of this function to a file
Question 6
Read a number as input and do the following:
Write a function to print the Fibonacci series up to given ‘n’ number.
Write the results of this function to a file
Question 7
Develop a function that prints the following pattern:
1
222
333
4444
55555
..............
The number of lines must be given as input.
Write a program to read n number of elements and write a function search() which can find the given number in the list
Question 8
Write a program to take an input array of ‘n’ numbers.
Develop two functions min() and max() to find the smallest and largest element of in the list.
Write the results of this program to two different file min.txt and max.txt
Question 9
Write a program to take an input array of ‘n’ numbers.
Develop a function Sort() which takes array as input and sort the elements.
The sorted list of elements must be saved on to a text file
Question 10
You are given an array of marks of size 5, where marks[i] represents the score of the i-th student in a class. Write a function to determine and return the highest and lowest marks in the class.
Write a program to print the integers from 1 to N and then N to 1 for the given input number ‘N’ using recursion
Question 11
You are given an array of marks of size 5, where marks[i] represents the score of the i-th student in a class. Write a function to determine and return the highest and lowest marks in the class.
Write a program to find the GCD of two numbers ‘a’ and ‘b’ by defining a recursive function GCD(a, b).
Question 12
You are required to create a program that represents an employee's details (name, age, and salary) using structures.
Read 5 records from user and save the same records onto a file with name "employee.txt"
Question 13
Write a program to check whether the given input string is a palindrome or not
You are required to create a program that represents an employee's details (name, age, and salary) using structures. Based on the salary, calculate the bonus and display the total salary after adding the bonus.
If the salary is greater than or equal to $50,000, the bonus is 10% of the salary.
If the salary is less than $50,000, the bonus is 5% of the salary.
Question 14
Write a program that:
Accepts the student's name, roll number, and marks for 5 subjects.
Calculates the average marks.
Assigns a grade based on the average marks:
Grade 'A' if the average is greater than or equal to 75.
Grade 'B' if the average is between 50 and 74 (inclusive).
Grade 'C' if the average is less than 50.
Question 15
Read a list of numbers and write a function Sort() that sorts the list in ascending order
Modify the function to sort the list in descending order