วันเสาร์ที่ 21 กันยายน พ.ศ. 2556

Loop (Hard)


Write Java program to print the table of characters that are equivalent to the Ascii codes from 1 to 122.

Solution:

void setup() {
  Characters();
}

void Characters() {

  int i =1;
  while (i <=122)
  {
    print((char)i+"\t");
    if (i % 10 == 0) {
      print("");
    }
    i++; 
  }
}

ไม่มีความคิดเห็น:

แสดงความคิดเห็น