Coders Packet

C++ program to convert a String into Binary

By Aalok Kumar

Hello programmers, here is a c++ program to convert a string into its binary equivalent.

To implement this program for ASCII encoding of plain text into binary in C++.

The program converts a string or a line of text into its binary equivalent.

Here is the explanation to use this program:

The first line takes a string or a line of text as input.

The second line output the binary equivalent of the string or line of text in ASCII encoding.

Note: Do not enter line break as input text.

Sample input and output is shown below:

Input:
Enter the text that is to be converted: CodeSpeedy Technology Private Limited is an Information technology company.
Output: 01000011 01101111 01100100 01100101 01010011 01110000 01100101 01100101 01100100 01111001 00100000 01010100 01100101 01100011 01101000 01101110 01101111 01101100 01101111 01100111 01111001 00100000 01010000 01110010 01101001 01110110 01100001 01110100 01100101 00100000 01001100 01101001 01101101 01101001 01110100 01100101 01100100 00100000 01101001 01110011 00100000 01100001 01101110 00100000 01001001 01101110 01100110 01101111 01110010 01101101 01100001 01110100 01101001 01101111 01101110 00100000 01110100 01100101 01100011 01101000 01101110 01101111 01101100 01101111 01100111 01111001 00100000 01100011 01101111 01101101 01110000 01100001 01101110 01111001 00101110

 

Download project

Reviews Report

Submitted by Aalok Kumar (Aaloks766626)

Download packets of source code on Coders Packet