Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String pattern ( int n) {
- if(n<1) return "";
- String finaloutput ="";
- for(int i=1; i<=n; i++) {
- for(int j=n; j>=i; j--)
- finaloutput=finaloutput+j;
- finaloutput=finaloutput+"\n";
- }
- return finaloutput.substring(0,finaloutput.length()-1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement