Computer Science, asked by senguptapriyon, 10 hours ago

Write a program to print 7, 14, 21, 28, .... 70​

Answers

Answered by purveshKolhe
6

\huge{\green{\overbrace{\underbrace{\purple{\mathfrak{answer::}}}}}}

\sf{\underline{Java::}}

public class Range{

    public static void main(String [] args) {

         for (int i = 7; i < 71; i += 7) {

              System.out.println(i);

         }

    }

}

\sf{\underline{Python::}}

for i in range(7, 71, 7):

    print(i)

\huge{\green{\boxed{\mathfrak{\red{Logic}}}}}

  • We ran a for loop from 7 to 71 with 7 steps which printed the pattern.
  • We used methods like print of python and Sopln of java to print the numbers returned by for loops
  • And it is finished...

Hope it helps...

Similar questions