Home
Q&A
Education
Technology
Credit
General
Health
Insurance
Questions
Ask a Question
Using nested loop write a program to print the following pattern on the screen.12345234513451245123
Home
Education
Using nested loop write a program to print the...
asked
Dec 13, 2021
in
Education
by
JackTerrance
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
computer-science-interview-questions
computer-science-questions
1
Answer
0
votes
answered
Dec 13, 2021
by
JackTerrance
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
Q: write a program to input a number and print table of the number using while loop
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a C program to print the following pattern:10 11 0 10 1 0 1
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a C program to print the following pattern:10 11 0 10 1 0 1
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a menu-driven program to print the following patterns, where number of rowsfor the pattern should be the user input:a. Press 1 to print the following pattern:55 85 8 135 8 13 205 8 13 20 29b. Press 2 to print the following pattern:22 92 9 282 9 28 652 9 28 65 126c. Print the following series:
Write a menu-driven program to print the following patterns, where number of rows for the pattern should be the user ... 2 4 8 32 Select the correct answer from above options...
asked
Nov 29, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a C program to print the following pattern:10 11 0 10 1 0 1
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: Write a program in JAVA to print this pattern :-1121231234
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: 1.) The following program is supposed to print the following pattern. Some part of the program is re
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: WAP in java to input 3 numbers from user and print the largest no. among them using nested if.
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: Rewrite the following loop using for loop:int i=0;while (i<10){System.out.print(“*”);System.out.print(i++);
Rewrite the following loop using for loop: int i=0; while (i...
asked
Dec 22, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: write a java program to print areaof an equilateral triangle . (without using scanner)
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: write a program to print fibonacci series . write a program to search an element within the array using binary search
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: 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)
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: Analyse the given program segment and answer the following questionsi) write the output of the program segment ii)how many times does the body of the loop gets executefor(int m=5 ; m<=20 ;m+=5){if (m%3= = 0)break;elseif (m%5= = 0) System.out.println(m) continue;}
Analyse the given program segment and answer the following questions i) write the output of the program segment ii)how many times ... body of the loop gets execute for(int m=5 ; m...
asked
Nov 29, 2021
in
Education
by
JackTerrance
computer-science-interview-questions
computer-science-questions
0
votes
Q: Plz write a program for the following pattern in Java class 10 ICSE2 6 12 20 30 424 6 8 10 122 2 2 20 0 0000
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
computer-science-interview-questions
computer-science-questions
0
votes
Q: write a menu driver program in java for the following pattern** **** ** *
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
computer-science-interview-questions
computer-science-questions
...