#include<iostream>
using namespace std;
int main(){
cout<<"enter size of hollow diamond";
int n;
cin>>n;
if(n%2==0)
n++; // here I am dealing with odd size
for(int i=0;i<n;i++){// for the first line
cout<<"*";
}
cout<<"\n";
int p,k=n/2;
p=k;
int j,l,m,o=1;
for(i=0;i<p;i++){//for top half
for(j=0;j<k;j++){//for left quarter
cout<<"*";
}
for(l=0;l<o;l++){// for space
cout<<" ";
}
for(m=0;m<k;m++){//for right quarter
cout<<"*";
}
cout<<"\n";
k--;
o+=2;
}
k+=2;
o-=4;
for(i=0;i<p-1;i++){//for the bottom half
for(j=0;j<k;j++){//for left quarter
cout<<"*";
}
for(l=0;l<o;l++){// for space
cout<<" ";
}
for(m=0;m<k;m++){//for right quarter
cout<<"*";
}
cout<<"\n";
k++;
o-=2;
}
for(i=0;i<n;i++){//for last line
cout<<"*";
}
return 0;
}
You first learn how to program in C.
Stephen C. Diamond has written: 'DOE-1 verification program plan' -- subject(s): Data processing, Energy conservation, Architecture and energy conservation, Buildings, Programming languages (Electronic computers)
the features of a C program
c program was introduced in the year 1972 by Dennis RitchieNo, it was the C language, not the C program.
I think it is 'execution of a C program'.
how to create a c program for left factoring.
Cane
C, its a pure carbon compound with no definite number of Carbons since the entire structure of a diamond is one lattice, therefore a diamond is just carbon.
Diamond is more than 1000 times harder than quartz, which is in the 80 range in the Rockwell C. Diamond cannot be measured on the Rockwell C scale. A diamond pyramid is actually used in the Rockwell C test, which would be inconclusive.
find the program in c-pgms.blogspot.com
what are the parts of C language program
a c program for creat a virus