# C Programming Code Examples

## C > Strings Code Examples

Page 1 Page 2 Page 3 Page 4 Page 5

Page 1 Page 2 Page 3 Page 4 Page 5

Code Get Highest Order Set Bit of Number

Highest position of a set bit from left to right in a number is said to be highest order set bit of that number. Highest order set bit of any negative integers is 31. Since, highest order...

Calculate Sum of Natural Numbers in C++

Program takes a "positive integer" from user, then displays the value of '1+2+3+....+n'. This C++ program code assumes that user always enters positive number. So if enters negative

C++ Coding Sorts a Data using Heap Sort

Heap sort is comparison based algorithm. It's selection sort sample. The time complexity is O(n*log(n)). Build a max heap using the given data element. And then Delete the root node

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

Function expression, array expression, unary minus, structure operators, increment and decrement, one's compliment, left and right shift, size of operator, pointer operators, type

Addition Operation use Bitwise Operators

C++ Program perform addition using bitwise operators. Using "AND" and "XOR" operators addition can be done, where carry is given by "AND" between two operands and result can

Code Find Maximum Between 2 Numbers

C program code to input two numbers and find maximum between two numbers using conditional/ternary operator ?:. How to find maximum minimum between two numbers

Simple C++ Coding for Single Inheritance

Start the C++ program. Declare the base class emp. Define and declare the function get() to get the employee details. Declare the derived class salary. "Declare and define" the function