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
void main(){ int a; a=1; while(a-->=1) while(a-->=0); printf("%d",a); }
Explain can the sizeof operator be used to tell the size of an array passed to a function?
What is a pointer in c?
Write a program to reverse a string.
List some basic data types in c?
What is meant by keywords in c?
Explain how do you determine the length of a string value that was stored in a variable?
What is the difference between printf and scanf )?
What is adt in c programming?
What is derived datatype in c?
Can you write a programmer for FACTORIAL using recursion?
Why main is not a keyword in c?
Tell me what is the purpose of 'register' keyword in c language?
Where register variables are stored in c?
What could possibly be the problem if a valid function name such as tolower() is being reported by the C compiler as undefined?