How to add code to a document

Document created by galit.ganor on Dec 17, 2015Last modified by Dameon Welch-Abernathy on Dec 3, 2018
Version 8Show Document
  • View in full screen mode

There is a very simple way to add pieces of code to documents.



On the right side of the editor toolbar there is a shy looking >> icon. It actually has some powerful features.



Use it to choose the type of code to add and paste the code.


#include <iostream>  using namespace std;  int main() {   for ( int x = 0; x < 128; x++ ) {   cout<< x <<". "<< (char)x <<" ";    //Note the use of the int version of x to    // output a number and the use of (char) to    // typecast the x into a character   // which outputs the ASCII character that    // corresponds to the current number   }   cin.get(); }  


this is an example of a C++ code



1 person found this helpful