+ 3
Do this challenge
ask the user to enter a value if i write 5 this appers on screen * ## $$ **** ##### the patern is after row of*, #,$ the pattern repeats. As the user enters 7 * ## $$ **** ##### $$$ ******* This program should be true for all numbers. Try hard sololearners and good luck.
10 Answers
+ 6
+ 10
+ 6
https://code.sololearn.com/cl01x1wxSP3P/?ref=app
+ 5
@Saksham kumar sharma
Any problem in the code? Did it fail for any input? Please let me know...
+ 4
/* Here is one Java solution */
public class Program {
public static void main(String[] args) {
int n = new java.util.Scanner(System.in).nextInt();
char[] ch = new char [] {'*', '#', '#x27;};
for (int i = 0, j = 0; i < n; i++, j++) {
if (j == ch.length) j = 0;
for (int k = 0; k <= i; k++) {
System.out.print(ch[j]);
}
System.out.println();
}
}
}
+ 3
well done kinshuk
+ 3
With itertools and Python it's easy:
https://code.sololearn.com/cHV0zMCxZaV6/?ref=app
+ 2
no
+ 1
wow