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
How can you avoid including a header more than once?
What is the heap in c?
Explain the difference between getch() and getche() in c?
Why c is called free form language?
In c programming language, how many parameters can be passed to a function ?
What is the purpose of the statement: strcat (S2, S1)?
What is const keyword in c?
What is the use of function overloading in C?
Write a Program to find whether the given number or string is palindrome.
What is the use of structure padding in c?
Why double pointer is used in c?
What's the difference between constant char *p and char * constant p?
What should malloc(0) do? Return a null pointer or a pointer to 0 bytes?
explain what is an endless loop?
How can I split up a string into whitespace-separated fields?