# C Programming Code Examples

## C > Strings Code Examples

### find First and Last Occurrence of given Character in a String

Polymorphism is a Feature using which an -
Function overloading & Operator overloading are examples of "Polymorphism". In The C++ programming In function overloading we can have more than one function by 'same name'

C Codes Multiply 2 Numbers use Function -
Create a user defined function product() that multiplies the numbers that we are passing to it during function call. This c function returns the product of these numbers. To understand

C++ Codes Heap's Algorithm Permutation -
The time complexity of this algorithm: 'O(n!)'. This algorithm 'takes the input' of "N" distinct numbers. It fixes an element at the end of the array and permutes the "remaining numbers"

Check if a Number is Positive or Negative -
C Language check if a number is positive or negative using nested if...else. This program takes a number from user & checks whether that number is either positive or negative or

Program to Find Minimum Spanning Tree -
This C++ program sample depicts the Prim's Algorithm which finds the minimal spanning tree(tree consisting of the minimum weights of edges connecting any 2 vertices) in graph.

Overridings Non-Virtual Functions in C++ -
See that problem. Even though we have the parent class pointer pointing to the instance of child class, the parent class version of the function is invoked. You may thinking why I

If Statement Check the Number is Less or -
The statements inside if parenthesis (usually referred as if body) gets executed only when the given condition is true. If the condition is false then the statements "inside if body" are

Use Local Variables in The C++ Language -
Global variables are accessible in full file. But "local variables" are not accessible in full file. And the local variable's scope is between the block of instruction that is defined between