From a6fab9e0b9b92f0acd0529a4fcabaf6b915c32f1 Mon Sep 17 00:00:00 2001 From: Venkatesh S Date: Sun, 20 Oct 2019 22:51:16 +0530 Subject: [PATCH 1/3] Program to display the pattern with alphabets --- AlphabetPattern.java | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 AlphabetPattern.java diff --git a/AlphabetPattern.java b/AlphabetPattern.java new file mode 100644 index 0000000..fbb0f7b --- /dev/null +++ b/AlphabetPattern.java @@ -0,0 +1,11 @@ +public class AlphabetPattern{ + public static void main(String args[]){ + char c = 'A'; + + for(int i = 0; i < 5; i++){ + for(int j = 0; j <= i; j++) + System.out.print((char)(c + j) + " "); + System.out.println(); + } + } +} \ No newline at end of file From f39c33948680986e56a04f1f934eab1e8d44fce3 Mon Sep 17 00:00:00 2001 From: Venkatesh S Date: Mon, 21 Oct 2019 00:06:00 +0530 Subject: [PATCH 2/3] Program to display the factorial of a given whole number --- Factorial.class | Bin 0 -> 1589 bytes Factorial.java | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 Factorial.class create mode 100644 Factorial.java diff --git a/Factorial.class b/Factorial.class new file mode 100644 index 0000000000000000000000000000000000000000..028e7146481a1a4233ded7a3c7b23bde80254772 GIT binary patch literal 1589 zcmaJ>Yf}?f7=BJJY_hHb0R<`IYEgq!qP^IbcqJ8y22n$`)XU5vIlwWSJ(=tYHQ(F+ z&>zs5er<6E9G&q8_*485+V^Z0NEMt+&gDJt^St+c`~KA%0N>-OjX|7DV*p>;a4>F` zQx;CAaRyl%Nlcj2*%T&ie1&sHGG!rW<2)`H-LGweev>g=M&Spe@S}xk3wZ|ioZ(36 z8DHnQI@fEt8M#{YwOAERdhEF*eW|Z7#Iq9*7!n0l6%4&4>5Dt9`m$&)@@0=C=@nkl zswuh0a5P(-*pKgES@TM5o;M;~qRypH_Op*V2#@=#xw39be>HCm+GW*hR>Z6{Mh?wx z8<{fhIvB#RgTpxD;1Vu7xPq$;{b3|6Exla1!hK&fEnIVO9WzG1;NU0RV94E|5SuP{ ze_K9TO!K?(E54k>4D_lR6dW}wj=DrRXCbPxQX0zJ{)hZ0dqueDc zo(hD82d3P=GK}vQR{HCzCZbmF80~n~w(ywduB240)nIUnriBY04+24+{MntJh@;b4 zbKI|bA{g%g^Pi4Wm*juI#dbsNq24`^oi5Bry%R4Ow&&5QMw(Yozb2=y9M@ds5nAvPbf?fh-NQRT?nDTiIGG# zKa%(hLmP;V{P7a;O(b3*_B%fO{ox(S{vm=G3{3_JT2n~VZ;19|I6!}pG?o}9*%*#T z51D9XJSsHzbgIhR6w&-b;ZoRM22W+CBR5H8X zkHI3UUNY8C;b$n=0i34rFOn0}bc@5K_ZTH-iFTV@c!)>%g%a{D-BWb`j{X<_16tvb Af&c&j literal 0 HcmV?d00001 diff --git a/Factorial.java b/Factorial.java new file mode 100644 index 0000000..70ce2df --- /dev/null +++ b/Factorial.java @@ -0,0 +1,25 @@ +import java.math.BigInteger; +import java.util.Scanner; + +public class Factorial { + static BigInteger x; + + static BigInteger factorial(int n) { + for(n = n - 1; n > 1; n--) + x = x.multiply(BigInteger.valueOf(n)); + + return x; + } + + public static void main(String args[]) { + Scanner scanner = new Scanner(System.in); + + System.out.print("Enter a whole number to display its factorial: "); + int n = scanner.nextInt(); + x = new BigInteger(Integer.toString(n)); + + System.out.println("Factorial of " + n + " is: " + factorial(n)); + + scanner.close(); + } +} From 497e25a73aa5f4c078d568ee12c31317c30b3082 Mon Sep 17 00:00:00 2001 From: Venkatesh S Date: Mon, 21 Oct 2019 00:10:45 +0530 Subject: [PATCH 3/3] Program to display the factorial of a given whole number --- Factorial.class | Bin 1589 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Factorial.class diff --git a/Factorial.class b/Factorial.class deleted file mode 100644 index 028e7146481a1a4233ded7a3c7b23bde80254772..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1589 zcmaJ>Yf}?f7=BJJY_hHb0R<`IYEgq!qP^IbcqJ8y22n$`)XU5vIlwWSJ(=tYHQ(F+ z&>zs5er<6E9G&q8_*485+V^Z0NEMt+&gDJt^St+c`~KA%0N>-OjX|7DV*p>;a4>F` zQx;CAaRyl%Nlcj2*%T&ie1&sHGG!rW<2)`H-LGweev>g=M&Spe@S}xk3wZ|ioZ(36 z8DHnQI@fEt8M#{YwOAERdhEF*eW|Z7#Iq9*7!n0l6%4&4>5Dt9`m$&)@@0=C=@nkl zswuh0a5P(-*pKgES@TM5o;M;~qRypH_Op*V2#@=#xw39be>HCm+GW*hR>Z6{Mh?wx z8<{fhIvB#RgTpxD;1Vu7xPq$;{b3|6Exla1!hK&fEnIVO9WzG1;NU0RV94E|5SuP{ ze_K9TO!K?(E54k>4D_lR6dW}wj=DrRXCbPxQX0zJ{)hZ0dqueDc zo(hD82d3P=GK}vQR{HCzCZbmF80~n~w(ywduB240)nIUnriBY04+24+{MntJh@;b4 zbKI|bA{g%g^Pi4Wm*juI#dbsNq24`^oi5Bry%R4Ow&&5QMw(Yozb2=y9M@ds5nAvPbf?fh-NQRT?nDTiIGG# zKa%(hLmP;V{P7a;O(b3*_B%fO{ox(S{vm=G3{3_JT2n~VZ;19|I6!}pG?o}9*%*#T z51D9XJSsHzbgIhR6w&-b;ZoRM22W+CBR5H8X zkHI3UUNY8C;b$n=0i34rFOn0}bc@5K_ZTH-iFTV@c!)>%g%a{D-BWb`j{X<_16tvb Af&c&j