Monday, March 26, 2012

Program to print Ascii equivalents of any given number in c++


/**************<soeasyprograms.blogspot.in>*****************/


#include <iostream.h>
#include<conio.h>
void main()
{
char word[32];
int x = 0;
clrscr();
cout << "Please enter the word (maximum 32 characters):\n";
cin >> word;     cout << "The ASCII for this word is:\n";
while (word[x] != '\0')    // While the string isn't at the end...
{
cout << int(word[x]);    // Transform the char to int
x++;
}
cout << "\n";
getch();
}
/**************<soeasyprograms.blogspot.in>*****************/

No comments:

Post a Comment