New Batch#100 (10th Nov 2021) - Salesforce Admin + Dev Training (WhatsApp: +91 - 8087988044) :https://t.co/p4F3oeQagK

Showing posts with label Multiplication pattern with Apex. Show all posts
Showing posts with label Multiplication pattern with Apex. Show all posts

Thursday, 4 February 2016

Multiplication pattern with Apex

Multiplication Pattern -

/*     10*2 =20     20*2 =40     40*2 =80     80*2 =160     160*2 =320 */ public class Apptitude {     public static void multiplicationPattern1(Integer num) {         Integer n = num;         for(Integer i=0;i<n;i++) {             system.debug(Integer.valueOf((math.pow(2, i)*10))+'*2 ='+Integer.valueOf((math.pow(2, i)*20))+'\n');         }     } }

Labels