# C Programming Code Examples

## C > Mathematics Code Examples

### C Program to Check if a given Number is Prime number

Reverse the Digits of a Number in 3 Steps -
C programming code to reverse the digits of a number in 3 steps. Store number in form of string. Reverse string using strrev function. Convert string to number. Printing reversed

Find the Trace & Normal of a given Matrix -
C Program find the trace & normal of a given matrix. Trace of the matrix is the sum of the elements of the main diagonal i.e diagonal from the upper left to the lower right of a...

C Program Code Concatenates two Strings -
You can 'concatenate two strings' easily using standard library function strcat() but, in this C program 'concatenates two strings' manually without using 'strcat()' function. Calculate the

C++ Coding Generating Random Numbers -
Following C++ program generate 100 random numbers using rand() function of stdlib.h. To generate random numbers in C++, we use the function rand() to generate and print random

C Program to find Transpose of a Matrix -
C program to read elements in a matrix and find transpose of the given matrix. How to find transpose of a given matrix in C. Input elements in matrix A from user. Declare...

C Program LCM while loop & if statement -
The LCM of two integers num1 and num2 is the smallest positive integer that is perfectly divisible by both num1 and num2 (without a remainder). For example: the LCM of 72 and

C Sender program using Message Queues -
This is the C sender program using Message Queues. A message queue program code that shows a client server implementation. Enter some message text you want to send.

Find Maximum Between 2 Numbers If Else -
Finding maximum in general is comparison of two numbers. In C programming we compare 2 quantities using relational operator. We can write expression to find maximum between j1