Like Us On Facebook

Follow Us On Twitter

Drop Down Menu

Tuesday 27 December 2016

Find Number Of Occurrences Of a Character In a String C Program

This program will find out the number of occurrences of each character in a string. So for example, if we have a string "I AM" then here the frequency of occurrence of each of 'I','A','M' will be 1. The program will print the same. This code can be easily modified to account for uppercase characters separately. 

C Code to transpose a matrix

Transposing a matrix means interchanging the rows and column elements of a matrix. For example, if we have a matrix:

1 2 3
4 5 6
7 8 9

Then its transpose will be:

1 4 7
2 5 8
3 6 9

Sunday 25 December 2016

Add Two Matrix C Code

This program will first ask user to enter the number of rows and columns for the two matrices. Remember, they have to be the same for both of the matrices. Then the program will ask the user to enter the elements of the first matrix and then the elements of the second matrix in the fashion:

First Matrix :-
2 3
4 5
Second matrix :-
3 4
5 6
then output of the program will be :-
5 7
9 11