# C Programming Code Examples

## C > Strings Code Examples

### replace all occurrences of a character in a string

Code find first & last digit of any number -
C program to input a number from user and find first and last digit of number using loop. Before I explain logic to find first digit, let us first learn to find last digit of a number. Find

Print Natural Number in Reverse in Range -
Logic to print Natural Number in reverse in a given range. If you got above logic, then you can easily modify to print natural numbers in reverse in given range. We need to make two

Perform Exception Handling for Divide by -
Declare the variables a,b,c. Read the values. Inside the "try block" check the condition. (a. if(a-b!=0) then "calculate the value" of d and display.b. otherwise throw the exception. So

Construct an Expression Tree For a Given -
Program, using recursion, evaluates a Prefix Expression in an "Expression Tree". A binary expression tree is a specific application of a 'binary tree' to evaluate certain expressions.

Undirected Graph Contain a Eulerian Cycle -
C++ Program to check whether an undirected graph contains "Eulerian Cycle". The criteran Euler suggested, If graph has no odd degree vertex, there is at least one eulerian circuit. If

Program Displays the Transpose of Matrix -
To transpose any matrix in C++ Programming language, you have to first ask to the user to enter the matrix and "replace row" by column and column by row to "transpose" that matrix

Matrix Multiplications Mutiply 2 Matrices -
Column number of first matrix must be same as the row number of second matrix. Initialize matrix. Print values of the passed matrix and mutiply two matrices and return the resultant

C++ Coding Add Two Numbers by Pointer -
To add two numbers using pointer in the C++, you have to enter the 2 number, then make 2 'pointer' type variable of same type say *ptr1 and *ptr2 to initialize the address of both the