Question & Additional Information
 
print star triangle
Add to My IQ
 

Answer Title
Answer
main()
{
 int n,row=1,col=40,i=0,j,k=0,count=1;
 int a[10];
 clrscr();
 i=n-1;
 printf("            WELCOME TO THE PROGRAM SIR/MADAM

<BR>);
 printf("Pyramid of how many numbers?  ");
 scanf("%d",&n);
 for (j=0;j<n;j++)
 {
  printf("Enter no.:-  ");
  scanf("%d",&a[j]);
 }
 clrscr();
 for (row=n;row>=1;row--)
 {
  k=0;
  k=40-(4*(row-1));
  i=row-1;
  for (col=40;col>=k;col=(col-4))
  {
   gotoxy(col,row);
   printf("%d",a[i]);
   --i;
  }
 }

 for (count=n;count>=1;count--)
 {
  k=0;
  k=40+(4*(count-1));
  i=count-1;
  for (col=40;col<=k;col=(col+4))
  {
   gotoxy(col,count);
   printf("%d",a[i]);
   --i;
  }
 }
 getch();
}

Question Tag Title
Tags
Question Asked At Title
Asked At
None
Question Job Title
Job Titles
None


Check out our newest job listings!

Post a Job! $49 for 60 days



Your Name:
Add your comment text
 
Related Questions
Related Questions
Flag this interview question as inappropriate Inappropriate
See Answer
sum of smaller 2 sides is greater than the other one which is larger
Create Date
:
Wednesday, May 14, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
420
Create Date
:
Tuesday, May 13, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
9000
Create Date
:
Tuesday, May 13, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
Flag this interview question as inappropriate Inappropriate
See Answer
420
Create Date
:
Tuesday, May 13, 2008
Tags
:
Asked At
:
None
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
9000
Create Date
:
Monday, May 12, 2008
Tags
:
Asked At
:
Job Positions
:
Click here to improve the Interview Question, Answer and other fields.
Comments (0) :
Goto add your comment on the Question 
 
• More Related Questions: 
Suggestions & Comments




Share Your Interview Questions
Ask Interview Questions
View Unanswered Questions





Advertise on this site