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 a void pointer in c?
Why void main is used in c?
7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.
How variables are declared in c?
What is masking?
What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file
What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?
What is a function simple definition?
What is the explanation for the dangling pointer in c?
Explain what does a function declared as pascal do differently?
c program for searching a student details among 10 student details
What is cohesion and coupling in c?
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
What is union and structure in c?
What is pointer & why it is used?