Answer Posted / raj
#define subscript 5
void spiral()
{
int a[subscript][subscript],i,j,k,l,m,p,q;
p=q=subscript ;
for(i=0;i<p;i++,p--)
{
for(j=i;j<n-1;j++)
printf("%d",a[i][j]);
for(k=i;k<j;k++)
printf("%d",a[k][j]);
for(l=k;l>i;l--)
printf("%d",a[l][k]);
for(m=k;m>i;m--)
printf("%d",a[i][m]);
}
if(q%2!=0)
printf("%d",a[j][j]);
}
Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is d'n in c?
What are c identifiers?
#include
What happens if a header file is included twice?
Are comments included during the compilation stage and placed in the EXE file as well?
Give differences between - new and malloc() , delete and free() ?
What is a substring in c?
Why does everyone say not to use gets?
can anyone please tell about the nested interrupts?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?
What is the scope of static variable in c?
What are actual arguments?
How can I copy just a portion of a string?
In C, What is the #line used for?
Can variables be declared anywhere in c?