# C++ Programming Code Examples

## C++ > Computer Graphics Code Examples

### Program to Use Above Below Primitive to Test Whether Two Lines Intersect

Finds Factorial of Number using Recursion - Declare recursive function to find factorial of a number. First let us give a meaningful name to our function, say fact(). Factorial Function accepts an integer input whose factorial is to

Sum of Natural Numbers using Recursion - C Program find the sum of Natural Numbers using recursion. The 'Positive Numbers' 1, 2, 3... are known as natural numbers. Program below takes a positive integer from the user

Program Convert Binary Decimal Number - To improve "readability of program" make a separate function and function should return the "resultant number". In main function user enters input number. Calls the function, pass

Convert Decimal to Octal in C++ language - To convert decimal number to octal number in C++ programming, you have to ask to the user to enter the decimal number to convert it into octal number to display the equivalent

Program Convert Decimal to Hexadecimal - C Language Program code to take a decimal number as input and store it in the variable decimalnumber. Initialize the variable j=0 & copy decimalnumber to variable quotient.

C Convert Binary to Octal Number System - Program input binary number and convert to octal number system. To make things simple and sound, I have divided the logic in 2 easy steps. Group all binary bits to 3 digits starting

Program Finds Sum of Digits of a Number - Logic to find sum of digits of a given number in C programming. The main idea to find sum of digits can be divided in three steps. Extract last digit of the given number. Add extracted

C++ Language Print Strings on the Screen - Enter a string and receive the string using the function 'gets()'. C++ program ask to the user to "enter a string" like your first name, then it will display your first name after "Hello", print