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
Can we use visual studio for c?
How pointer is different from array?
1. Write a function to display the sum of two numbers in the following ways: By using (i) pass by value (ii) pass by address a. function with argument and with return value b. function with argument and without return value c. without argument , with return value d. without argument , without return value Note: Use pass by address.
Tell us something about keyword 'auto'.
Describe how arrays can be passed to a user defined function
How do I round numbers?
How do you initialize pointer variables?
What is the 'named constructor idiom'?
What functions are used in dynamic memory allocation in c?
What are external variables in c?
What is scope rule of function in c?
In c programming, explain how do you insert quote characters (? And ?) Into the output screen?
Do pointers need to be initialized?
Why is c called c?
In C language what is a 'dangling pointer'?