diff --git a/ascii.java b/ascii.java new file mode 100644 index 0000000..e019e7c --- /dev/null +++ b/ascii.java @@ -0,0 +1,14 @@ + public class PrintAsciiValueExample1 + { + public static void main(String[] args) + { + // character whose ASCII value to be found + char ch1 = 'a'; + char ch2 = 'b'; + // variable that stores the integer value of the character + int asciivalue1 = ch1; + int asciivalue2 = ch2; + System.out.println("The ASCII value of " + ch1 + " is: " + asciivalue1); + System.out.println("The ASCII value of " + ch2 + " is: " + asciivalue2); + } + } diff --git a/left triangle.java b/left triangle.java new file mode 100644 index 0000000..7c78719 --- /dev/null +++ b/left triangle.java @@ -0,0 +1,21 @@ + public class RightTrianglePattern + { + public static void main(String args[]) + { + //i for rows and j for columns + //row denotes the number of rows you want to print + int i, j, row=6; + //outer loop for rows + for(i=0; i