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
What does emoji p mean?
What is main () in c?
What are 'near' and 'far' pointers?
How is a macro different from a function?
stripos — Find position of first occurrence of a case- insensitive string int stripos ( char* haystack, char* needle, int offset ) Returns the numeric position of the first occurrence of needle in the haystack string. Note that the needle may be a string of one or more characters. If needle is not found, stripos() will return -1. The function should not make use of any C library function calls.
what are the different storage classes in c?
Can main () be called recursively?
What is the value of c?
why we wont use '&' sing in aceesing the string using scanf
What is header file in c?
What is malloc() function?
hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm
How does normalization of huge pointer works?
What is the size of array float a(10)?
What are the different file extensions involved when programming in C?