<mosaic.cnfolio.com>
  1. #include <iostream>
  2. using namespace std;
  3. int main()
  4. {
  5.    char word[32];
  6.    int x = 0;
  7.    cout << "Please enter the word (maximum 32 characters):\n";
  8.    cin >> word;
  9.    cout << "The ASCII for this word is:\n";
  10.    while (word[x] != '\0')    // While the string isn't at the end...
  11.    {
  12.        cout << int(word[x]);    // Transform the char to int
  13.        x++;
  14.    }
  15.    cout << "\n";
  16.    return 0;
  17. }
  18.  
  19. /* using a do-while statement: */
  20.  
  21. i = 10;
  22.  
  23. // this is executed once, because the continuation condition is
  24. // not checked until after the body of the loop runs:
  25. do {
  26.    printf("do-while: i is %d\n", i);
  27.    i++;
  28. } while (i < 10);
  29.  
  30. printf("abcdef\n");
  31.  
  32.  
  33.  printf( "%d\n", char ( ) );
  34.    printf( "%d\n", charPlustwo( ))
  35.  
  36.  
  37. for (i = 0; i < 10; i++) {
  38.    printf("i is %d\n");
  39. }