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 are the different categories of functions in c?
Which is more efficient, a switch statement or an if else chain?
Why should I use standard library functions instead of writing my own?
a direct address that identifies a location by means of its displacement from a base address or segment a) absolute address b) relative address c) relative mode d) absolute mode
Can we use visual studio for c?
Is javascript based on c?
The difference between printf and fprintf is ?
What is the difference between strcpy() and memcpy() function in c programming?
Can you please explain the difference between exit() and _exit() function?
Define circular linked list.
Describe the order of precedence with regards to operators in C.
PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE
Program to find the sum of digits of a given number until the sum becomes a single digit. (e.g. 12345=>1+2+3+4+5=15=>1+5=6)
What is function prototype in c language?
What is include directive in c?