Computer Science, asked by garvgulati8735, 1 year ago

write a program to print the following series in java plz urgent​

Attachments:

Answers

Answered by AbhijithPrakash
1
  1. // Java program to print  
  2. // Floyd's triangle  
  3.  
  4. class Test  
  5. {  
  6. static void printFloydTriangle(int n)  
  7. {  
  8. int i, j, val = 1;  
  9. for (i=1; i<=n; i++)  
  10. {  
  11.  for (j=1; j<=i; j++){  
  12.   System.out.print(val+" ");  
  13.   val++;  
  14.  }  
  15.  System.out.println();  
  16.    
  17. }  
  18. }  
  19.  
  20. // Driver method  
  21. public static void main(String[] args)  
  22. {  
  23.  printFloydTriangle(5);  
  24. }  
  25. }  

I hope this helps you and please mark it as Brainliest Answer..

Similar questions