We will now post some shapes using c/c++ language.It will be defiantly helpful.If you need some more code for different kinds of shape then please email us-cprogtec@gmail.com
code----
#include<stdio.h>
int main(){
int i,j,n;
code----
#include<stdio.h>
int main(){
int i,j,n;
printf("put the size of the diamond");
scanf("%d",&n);
for(i=n;i>=1;i--){
for(j=1;j<=i;j++){
printf(" ",j);
}
for(j=0;j<=(n-i)*2;j++){
printf("*");
}
for(j=i;j>=1;j--){
printf(" ",j);
}
printf("\n");
}
for(i=1;i<=n;i++){
for(j=1;j<=i;j++){
printf(" ",j);
}
for(j=0;j<=(n-i)*2;j++){
printf("*");
}
for(j=i;j>=1;j--){
printf(" ",j);
}
printf("\n");
}
return 0;}
scanf("%d",&n);
for(i=n;i>=1;i--){
for(j=1;j<=i;j++){
printf(" ",j);
}
for(j=0;j<=(n-i)*2;j++){
printf("*");
}
for(j=i;j>=1;j--){
printf(" ",j);
}
printf("\n");
}
for(i=1;i<=n;i++){
for(j=1;j<=i;j++){
printf(" ",j);
}
for(j=0;j<=(n-i)*2;j++){
printf("*");
}
for(j=i;j>=1;j--){
printf(" ",j);
}
printf("\n");
}
return 0;}