Computer Science, asked by lizziebarman21, 1 year ago

write a program to print the first 20 natural numbers in reverse order .

Answers

Answered by harindersaini2pcf8vf
2

class abc    {      void main()       {          int i;          for(i=20; i>=0; i--)          System.out.println(i);       }   }   Hope it helps :-)


lizziebarman21: it helped a lot thank you so so much to answer this question
harindersaini2pcf8vf: You are welcome. The alignment is a little disturbed due to few problems in my keyboard, I am sorry for that.
lizziebarman21: it is OK.. and thanks once again
Answered by stylishtamilachee
4

Answer:

public class Test

{

void prnRevNaturalNos( )

{

int i ;

for( i = 20 ; i > = 1 ; i-- )

System.out.print( i ) ;

}

}

Output produced is:

20 19 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1

Java:

Java is a popular third-generation programming language, which can be used to do any of the thousands of things that a computer software can do.

With the features it offers, Java has become the language of choice for internet and intranet applications.

Java plays an important role for the proper functioning of many software-based devices attached to the network.

Similar questions