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 masking?
What is equivalent to ++i+++j?
write a c program to calculate sum of digits till it reduces to a single digit using recursion
What is the difference between single charater constant and string constant?
How can I insert or delete a line (or record) in the middle of a file?
What is Dynamic memory allocation in C? Name the dynamic allocation functions.
Can you please explain the difference between strcpy() and memcpy() function?
How is null defined in c?
What is methods in c?
What are the applications of c language?
Is it possible to use curly brackets ({}) to enclose single line code in c program?
Write a program to compute the similarity between two strings - The program should get the two strings as input - Then it will output one single number which is the percentage of similarity between the two strings
How to implement a packet in C
Does c have function or method?
What are the difference between a free-standing and a hosted environment?