in Education by
Write a program in JAVA to print : 1 12 123 1234 12345 Select the correct answer from above options

1 Answer

0 votes
by
 
Best answer
class pattern_1 { public void main() { for(int i=1;i<=5;i++) { for(int j=1;j<=i;j++) { System.out.print(j+” “); } System.out.println(); } } } The pattern is printed according to the above logic . The i-loop is used for the rows . The j-loop is used for the columns . The statement “println” helps to print the line gap . The statement “print” has no such gap . The printing is done by the j-loop and after the ‘j’ gets printed , I have added a space so that the program looks nice .

Related questions

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
    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 enter a sentence and check if it contains palindrome words or not. if yes then count and ... present. Java class 10 Select the correct answer from above options...
asked Dec 31, 2021 in Education by JackTerrance
0 votes
    How to write a program in JAVA to print the sum of ASCII values of a particular word input ? Select the correct answer from above options...
asked Dec 28, 2021 in Education by JackTerrance
0 votes
    Write a program in JAVA to input a sentence reverse every word and print . Please answer someone. Select the correct answer from above options...
asked Dec 13, 2021 in Education by JackTerrance
0 votes
    write a program in Java to input a number and print if it is a special number or not. do this program using ... nested and while loop . Select the correct answer from above options...
asked Dec 1, 2021 in Education by JackTerrance
0 votes
    Write a program in Java to print all palindromic numbers between 150-250. Select the correct answer from above options...
asked Dec 1, 2021 in Education by JackTerrance
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 PROGRAM TO READ DETAILS LIKE NAME, CLASS , AGE OF A STUDENT AND THEN PRINT THE DETAILS FIRSTLY IN ... THEN IN SEPERATE LINES Select the correct answer from above options...
asked Dec 30, 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 the phython code for the following . Write a program to print area perimeter of rectangle. Select the correct answer from above options...
asked Dec 29, 2021 in Education by JackTerrance
0 votes
    Write a python program to print first n(entered by user) even natural numbers. Select the correct answer from above options...
asked Dec 25, 2021 in Education by JackTerrance
0 votes
    write a program code to print area and perimeter of a rectangle Select the correct answer from above options...
asked Dec 23, 2021 in Education by JackTerrance
0 votes
    → Write a program to print your details int soll Number, string className, string Name. I want this program with ... for lifetime Select the correct answer from above options...
asked Dec 22, 2021 in Education by JackTerrance
0 votes
    write a program to input number and print wether it is even or odd. Select the correct answer from above options...
asked Dec 21, 2021 in Education by JackTerrance
...