Advertisement
yashu2000

SIF Application Question

Sep 15th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.52 KB | None | 0 0
  1. //this method is in Java
  2. //Made by Yashaswi Sharma
  3. public static void printingFunction (int n) {
  4.    
  5.     //instantiates a local variable to count from 1 to n
  6.     int i = 1;
  7.    
  8.     //loops through to n while printing the desired functionalities
  9.     while (i < n) {
  10.        
  11.         if (i % 2 == 0 && i % 7 == 0)
  12.             System.out.println ("Quant Team");
  13.        
  14.         else if (i % 2 == 0)
  15.             System.out.println ("Quant");
  16.        
  17.         else if (i % 7 == 0)
  18.             System.out.println ("Team");
  19.        
  20.         else
  21.             System.out.println (Integer.toString (i));
  22.        
  23.         i++;
  24.     }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement