C++ Program to Convert Decimal to Any Base

This C++ Program demonstrates the Conversion of a Number from a Decimal Base to Any Base less than the Number. Here is source code of the C++ Program to Convert a Number from Decimal Base to Any Base. The C++ program is successfully compiled and run on a Linux system. The program output is also … Read more

C++ Program to Convert Hours to Minutes and Seconds

This is a C++ Program to Convert Hours in Terms of Minutes and Seconds. Problem Description The program converts hours into minutes and seconds. Problem Solution 1. The program takes number of hours and stores it. 2. Hours are converted into minutes by multiplying with 60. 3. Seconds are calculated by multiplying minutes with 60. … Read more

C++ Program to Convert Fahrenheit to Celsius

This C++ program performs conversion of temperature from fahrenheit to celsius. The program takes temperature in fahrenheit degrees performs conversion to celsius degrees using a function and prints the value on standard output stream. Here is the source code of the C++ program performs conversion of temperature from fahrenheit to celsius. The C++ program is … Read more

C++ Program to Convert Celsius to Fahrenheit

This C++ Program performs Celsius to Fahrenheit conversion. The program reads the temperature in Celsius, multiplies the temperature in Celsius by 9 / 5 and adds 32 to obtain temperature in Fahrenheit. Here is source code of the C++ program which performs Celsius to Fahrenheit conversion. The C++ program is successfully compiled and run on … Read more

C++ Program to Convert Binary Code to Gray Code

This is a C++ Program to Convert a Number in Binary Representation to Gray Code. Problem Description The program takes a binary number and converts it into its equivalent Gray code. In Gray code, any two successive values differ only by one bit. Problem Solution 1. A binary number is entered. 2. Using a while … Read more

C++ Program to Convert Gray Code to Binary Code

This C++ program which converts given Gray Code to Binary Code. Both the codes can be stored in a character string. The Binary Code is formed as follows: The most significant bit is same for both, the bit value of next position of Gray Code and previous Binary Code are XORed and stored in next … Read more

C++ Program to Convert Hexadecimal to Decimal

This is a C++ Program to Convert a Given Hexadecimal Number to its Decimal Equivalent. Problem Description The program takes a hexadecimal number and converts it into its decimal equivalent. Problem Solution 1. The program takes a hexadecimal number. 2. Its length is stored in a variable using a string function. 3. Using a for … Read more

C++ Program to Convert Decimal to Hexadecimal

This is a C++ Program to Convert a Decimal Number to its HexaDecimal Equivalent. Problem Description The program takes a decimal number and converts it into its hexadecimal equivalent. Problem Solution 1. A decimal number is entered. 2. Using a while loop, the number is divided by 16 and the hexadecimal equivalent of the remainders … Read more

C++ Program to Convert Octal to Decimal

This is a C++ Program to Convert a Given Octal Number to its Decimal Equivalent. Problem Description The program takes an octal number and converts it into its decimal equivalent. Problem Solution 1. The program takes an octal number. 2. Using a while loop, each digit is converted to its decimal equivalent by multiplying with … Read more