Computer Science, asked by kritika2727, 1 year ago

write a program in java to print the following series .Please . It's urgent

Attachments:

Answers

Answered by cynthiarai
0
import java.util.*;
class print
{
public static void main(String args[ ] )
{
Scanner in= new Scanner (System.in);
System.out.println("4 3 2 1 ");
System.out.println("4 3 2");
System.out.println("4 3 ");
System.out.println("4 ");
}
}

kritika2727: It's wrong .
kritika2727: u have to take I and j
kritika2727: to enter the values
kritika2727: his is nested loop program
cynthiarai: oh we r not taught loop in school sorry if the program is incorrect
kritika2727: It's ok
siddhartharao77: kindly correct ur code ..
Answered by siddhartharao77
5
class Brainly
{

public static void main(String args[])
{

int i,j;
for(i = 1; i<=4; i++)
{
for(j = 4; j >= i; j--)

{

System.out.print(j+" ");
}
System.out.println();
}
}
}


Hope this helps!
Attachments:

siddhartharao77: Any doubts. Ask me. Gud luck!
kritika2727: Will u help me in other programs when ever I will have doubt
Similar questions