Write a programme in C

138 views 7:07 am 0 Comments August 2, 2023

Write a programme in C that will add 2 matrix and print the output matrix. Matrix will be 3 by 3  matrix. Take the elements from the user as input.

Use function prototype:

void addMatrix(int rowSize, int colSize, int matA[rowSize][colSize], int matB[rowSize][colSize])

Write a programme in C that will subtract 2 matrix and print the output matrix. Matrix will be 4  by 4 matrix. Take the elements of the first matrix from the user as input. Then transpose the  first matrix to create the second matrix and subtract transpose matrix from the first matrix. Use function prototype:

void subtractMatrix(int rowSize, int colSize, int matA[rowSize][colSize], int

matB[rowSize][colSize])

3.Write a program in C to find the maximum number among 3 numbers using a pointer. Take the input from user.

4.Write a program in C that will print largest and the second largest elements of an array. Array  size will be 10 and the input will be taken from user.

5.Write a program in C that will find the even numbers and odd numbers from an array. The even  numbers will be stored an another array named evenArray and odd numbers will be stored in  the oddArray. Then print both array. The size of all 3 array will be 12. Prototype: void findEvenOddNumber(int size, int originalArr[], int evenArr[], int oddArr[]);

6.Write a program which reads string and rewrite it in alphabetical order. For example, the word  STRING should be written as GINRST.

7.Write a program to replace a particular word by another word in a given string. For example the  “PYTHON� should be replaced by “C� in the text “It is good to program in PYTHON language�.

8. Write a program that will find the maximum number from 3 float type numbers. You have to use
the function getMax which will take 3 pointer variables and return the maximum number

Tags: , , , , , , , , , ,