//work for numbers
for(int cst=1;cst<=nst;cst++)
{
if(cst!=n)
System.out.print(num+"\t");
num++;
}
Also why are most of the solutions to the questions in java, when this is a course of c++?
//work for numbers
for(int cst=1;cst<=nst;cst++)
{
if(cst!=n)
System.out.print(num+"\t");
num++;
}
Also why are most of the solutions to the questions in java, when this is a course of c++?
/Users/isha/Downloads/pattern_Mountain.java
@isingh see in the last line of the pattern, all numbers are printed twice, but 4 is printed only once
1 2 3 4 3 2 1
so to avoid printing it twice, the condition is used