
1
212
32123
4321234
543212345
I Want Java code for this pattern..................

#include<stdio.h>
#include<conio.h>
int main()
{
int i,j,n;
printf("enter the val of n:\t");
scanf("%d",&n);
for(i=1;i<=n;i++){
for(j=n;j>=i;j--){
printf(" ");
}
for(j=1;j<=2*i-1;j++){
if(i-j>0){printf("%d",i-j+1);}
else{printf("%d",j-i+1);}
}
for(j=n;j>=i;j--){
printf(" ");
}printf("\n");
}
getch();
return 0;
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.