C++ Programming Code Examples

C++ > Conversions Code Examples

Write a program in C++ to convert a decimal number to octal number.

Find Factorial of a Number with Recursion - C program to find factorial of a number using recursion. The factorial of a 'positive number' n is given by: factorial of n (n!) = 1*2*3*4....n The factorial of a 'negative number' does not

C Programming Infix to Prefix Conversion - Structure declaration, condition for do-while loop, to input string, enter the infix string, to covert infix to prefix, checking for operand, to convert infix to postfix, to check for operand

Count Number of non leaf nodes of a tree - C create a new node with the data from the user. Check for root node and then create it. Search for the appropriate position to insert the new node. Display and count the sum of

Getting a User Input as String in The C++ - This can be considered as inefficient method of reading user input, why? Because when we read the user input string using cin then only the "First word of the String" is stored in char

Printing 100 Ramanujan Numbers 2 Ways - C++ Sample code Print first 100 "Ramanujan Numbers" by TWO WAYS 1st way is printing ramunajan numbers from RN taking RN from 0 to INFINITY & print first 100 numbers. 2nd

C Code using of &(ampersand) *(asterisk) - C We have already seen in the first example that we can display the address of a variable using ampersand sign. I have used &num to access the address of variable num. The &...

C code simple Two Dimensional(2D) Array - Program code demonstrates how to store the elements entered by user in a 2d array and how to display the elements of a 2D array. Two dimensional array in C programming is

Implement a Binary Search Tree by Linked - This C++ program, displays the traversal of a "binary search tree" in inorder,postorder and preorder mode using "Linked Lists". A linked list is an ordered set of 'data elements', each