Sudip import java.util.*; public class Main { public static void main(String[] args) { int row,col,i,j,k,val; Scanner sc=new Scanner(System.in); row=sc.nextInt(); val=row-1; for(i=1;i<=row;i++) { for(j=1;j=1;i–) { for(j=1;j<=i;j++) { System.out.print(val++); } System.out.println(); val=val/2; } } } Log in to Reply
Divya import java.util.Scanner; public class Main { public static void main(String[] args) { int k=0; Scanner sc=new Scanner(System.in); int n= sc.nextInt(); for(int i=1;i<=((n%2==0)?n/2:(n/2)+1);i++){ for(int j=1;j=1;i–){ for(int j=i;j>=1;j–){ System.out.print(k); k–; } System.out.println(); } } } Log in to Reply
Divya import java.util.Scanner; public class Main { public static void main(String[] args) { int k=0; Scanner sc=new Scanner(System.in); int n= sc.nextInt(); for(int i=1;i<=((n%2==0)?n/2:(n/2)+1);i++){ for(int j=1;j=1;i–){ for(int j=i;j>=1;j–){ System.out.print(k); k–; } System.out.println(); } } } Log in to Reply
akashrana rana public class Main { public static void main(String[] args) { int n=7;int count=0;int sum=2;int c=1; for(int i=1;i<=n;i++){ if(i<=n/2+1){ sum=sum+c;count+=1; int s=sum; for(int j=0;j<count;j++){ System.out.print(s–); } c=c+1; } else{ c=c-1; sum=sum-c;count-=1; int s=sum; for(int j=0;j<count;j++){ System.out.print(s–); } } System.out.println(); } } } Log in to Reply
import java.util.*;
public class Main
{
public static void main(String[] args) {
int row,col,i,j,k,val;
Scanner sc=new Scanner(System.in);
row=sc.nextInt();
val=row-1;
for(i=1;i<=row;i++)
{
for(j=1;j=1;i–)
{
for(j=1;j<=i;j++)
{
System.out.print(val++);
}
System.out.println();
val=val/2;
}
}
}
Kindly refer this Link for discord channel.
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
int k=0;
Scanner sc=new Scanner(System.in);
int n= sc.nextInt();
for(int i=1;i<=((n%2==0)?n/2:(n/2)+1);i++){
for(int j=1;j=1;i–){
for(int j=i;j>=1;j–){
System.out.print(k);
k–;
}
System.out.println();
}
}
}
import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
int k=0;
Scanner sc=new Scanner(System.in);
int n= sc.nextInt();
for(int i=1;i<=((n%2==0)?n/2:(n/2)+1);i++){
for(int j=1;j=1;i–){
for(int j=i;j>=1;j–){
System.out.print(k);
k–;
}
System.out.println();
}
}
}
public class Main
{
public static void main(String[] args) {
int n=7;int count=0;int sum=2;int c=1;
for(int i=1;i<=n;i++){
if(i<=n/2+1){
sum=sum+c;count+=1;
int s=sum;
for(int j=0;j<count;j++){
System.out.print(s–);
}
c=c+1;
}
else{
c=c-1;
sum=sum-c;count-=1;
int s=sum;
for(int j=0;j<count;j++){
System.out.print(s–);
}
}
System.out.println();
}
}
}
nice website to learn new technologies