+ 1
patter logic can any one give me the code?? below pattern in c or java or c++ using for loop
abcdefg abc efg ab fg a g
3 Respostas
+ 2
c++ :
int n=7;
for(int i=0;i<n;++i){
for(int j=0;j<n;++j)
if(j>n/2-i && j<n/2+i)
cout<<" ";
else
cout<<(char)('a'+j);
cout<<endl;
}
+ 1
thanks u .....
+ 1
you are welcome :)