C++ Programming Code Examples
C++ > Mathematics Code Examples
Program to print all possible permutations of first n natural nos
C Code Perform all Arithmetic Operations -
C program input two numbers and perform all arithmetic operations. How to perform all arithmetic operation between two numbers in C programming. C program to find sum,...
C Checking Armstrong Number of n digits -
Check Armstrong Number of n digits. In case of an Armstrong number of 3 digits, the sum of cubes of each digits is equal to the number itself. Example 407 = 4*4*4 + 0*0*0 + 7*7*7
Sort Rows of the Matrix Ascending Order -
Program code sorts the rows of the matrix in ascending & columns in descending order. This program accepts matrix. Then sorts the row in an ascending order & the columns in
C Language Program Calculate Percentage -
Percent means per cent (hundreds), a ratio of the parts out of 100. The symbol of percent is %. We count 'Percentage of Marks Obtained', return on investment and Percentage can go
Convert Octal to Decimal Number System -
Program to input Octal number and convert to Decimal number. Octal number system is a base 8 number system. Octal number system uses 8 symbols to represent all its numbers...
Code print the address of array elements -
For loop to print value and address of each element of array. Just to demonstrate that the array elements are stored in contiguous locations, I am displaying the addresses in...
C++ Codings Quick Sort & Randomization -
Quick sort is based on an 'algorithmic' design pattern called 'divide-conquer'. Unlike Merge Sort it does not require 'extra memory space'. The average time complexity is "O(n*log(n))"
Nested Namespace in C++ Programming -
In C++ programming, you can create nested 'namespaces'. One namespace can be a part of another namespace. Simply we can create namespace X, which will contain namespace