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

advertisement

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

advertisement

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

advertisement

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

advertisement

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

advertisement

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

advertisement

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

advertisement

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

advertisement

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

advertisement

C++ Program to Convert Decimal to Octal

This is a C++ Program to Convert a Decimal Number to Octal Equivalent. Problem Description The program takes a decimal number and converts it into its octal equivalent. Problem Solution 1. A decimal number is entered. 2. The number is divided by 8 and the remainders are stored. 3. The result is printed in reverse … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.