code snippet for creating a pyramids triangle
ex
1
2 2
3 3 3
Answer Posted / rajesh kamar s
void main()
{
int n,i,j;
printf("enter the num of rows\t:");
scanf("%d",&n);
for(i=1;i<=n;i++)
{
for(int k=0;k<n-i;k++)
printf(" ");
for(j=1;j<=i;j++)
printf("%d ",i);
printf("\n");
}
}
| Is This Answer Correct ? | 1 Yes | 2 No |
Post New Answer View All Answers
Why is c so important?
write a C program: To search a file any word which starts with ?a?. If the word following this ?a? starts with a vowel.Then replace this ?a? with ?a? with ?an?. redirect with the output onto an output file.The source file and destination file are specified by the user int the command line.
What will be the outcome of the following conditional statement if the value of variable s is 10?
if the area was hit by a virus and so the decrease in the population because of death was x/3 and the migration from other places increased a population by 2x then annually it had so many ppl. find our the population in the starting.
What is a program flowchart and how does it help in writing a program?
What is #pragma statements?
How can I list all of the predefined identifiers?
The __________ attribute is used to announce variables based on definitions of columns in a table?
write an algorithm to display a square matrix.
What is d scanf?
What are the 4 data types?
typedef struct{ char *; nodeptr next; } * nodeptr ; What does nodeptr stand for?
How are structure passing and returning implemented?
What is the difference between functions getch() and getche()?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?