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 is uses of .net
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
Why is structure important for a child?
how to print the character with maximum occurence and print that number of occurence too in a string given ?
What is the best organizational structure?
What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file
Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.
largest Of three Number using without if condition?
Explain the difference between malloc() and calloc() in c?
What is #include stdio h and #include conio h?
What is getch?
Can you apply link and association interchangeably?
What is the use of typedef in structure in c?
What is the difference between NULL and NUL?
Explain what is the difference between a string copy (strcpy) and a memory copy (memcpy)? When should each be used?