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
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
What is the difference between memcpy and memmove?
What are the advantages of using linked list for tree construction?
Explain the use of 'auto' keyword in c programming?
Describe newline escape sequence with a sample program?
Write a C program to help a HiFi’s Restaurant automate its breakfast billing system. Your assignment should implement the following items: a. Show the customer the different breakfast items offered by the HiFi’s Restaurant. b. Allow the customer to select more than one item from the menu. c. Calculate and print the bill to the customer. d. Produce a report to present your complete program and show more sample output. Assume that the HiFi’s Restaurant offers the following breakfast menu: Plain Egg $2.50 Bacon and Egg $3.45 Muffin $2.20 French Toast $2.95 Fruit Basket $3.45 Cereal $0.70 Coffee $1.50 Tea $1.80
What is the size of enum in c?
What is the importance of c in your views?
If the size of int data type is two bytes, what is the range of signed int data type?
What are identifiers and keywords in c?
write a program in C that prompts the user for today's date,tomorrow's date and display the results.Use structures for today's date,tomorrow's date and an array to hold the days for each month of the year.
How do you use a pointer to a function?
What is the 'named constructor idiom'?
What are the 4 data types?
Write a program to produce the following output: 1 2 3 4 5 6 7 8 9 10