in Education by
Using nested loop write a program to print the following pattern on the screen. 12345 23451 34512 45123 51234 Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
Answer: import java.io.*; public class example { public static void main (String args[]){ int i, k, j; for(i=1;i<=5;i++){ for (j=1;j<=5;j++){ for(k=i;k<=5+1;k++){ if(k==5){ k=1; System.out.print(k); }}} System.out.println(); } }}

Related questions

0 votes
    write a program to input a number and print table of the number using while loop Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    Write a C program to print the following pattern: 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 Select the correct answer from above options...
asked Dec 7, 2021 in Education by JackTerrance
0 votes
    Write a C program to print the following pattern: 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 Select the correct answer from above options...
asked Dec 5, 2021 in Education by JackTerrance
0 votes
    Write a C program to print the following pattern: 1 0 1 1 0 1 0 1 0 1 1 0 1 0 1 Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    Write a program in JAVA to print this pattern :- 1 12 123 1234 12345 Select the correct answer from above options...
asked Dec 13, 2021 in Education by JackTerrance
0 votes
    1.) The following program is supposed to print the following pattern. Some part of the program is replaced by _n__ where ... (); } } } Select the correct answer from above options...
asked Dec 25, 2021 in Education by JackTerrance
0 votes
    WAP in java to input 3 numbers from user and print the largest no. among them using nested if. Select the correct answer from above options...
asked Dec 19, 2021 in Education by JackTerrance
0 votes
    write a java program to print areaof an equilateral triangle . (without using scanner) Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    write a program to print fibonacci series . write a program to search an element within the array using binary search Select the correct answer from above options...
asked Dec 29, 2021 in Education by JackTerrance
0 votes
    Write a program in python to insert ten friends name in a list, then print 3rd, 5th and 9th value from the list (using data structure) Select the correct answer from above options...
asked Dec 14, 2021 in Education by JackTerrance
0 votes
    Plz write a program for the following pattern in Java class 10 ICSE 2 6 12 20 30 42 4 6 8 10 12 2 2 2 ... spam. Answer only if you know Select the correct answer from above options...
asked Nov 30, 2021 in Education by JackTerrance
0 votes
    write a menu driver program in java for the following pattern ** *** * * * * * * Select the correct answer from above options...
asked Nov 27, 2021 in Education by JackTerrance
...