JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
[🏆CHALLENGE🏆] Create a triangle out of slashes!
Challenge:
Create a code that will take user input, and generate a centered and layered triangle out of slashes ("/", "\"), that has a base. Any language is welcome!
Example:
Input: 3
Output:
/\
/ \
/ \
******
*/
import java.util.Scanner;
public class GauravProgram
{ public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
int x=sc.nextInt();
int i,j,k;
int l=0;
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run