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 the use of getchar() function?
Is it possible to initialize a variable at the time it was declared?
What does the && operator do in a program code?
Is there a way to compare two structure variables?
What is maximum size of array in c?
What are the advantages and disadvantages of a heap?
What is the difference between specifying a constant variable like with constant keyword and #define it? i.e what is the difference between CONSTANT FLOAT A=1.25 and #define A 1.25
Hi how many types of software editions are there and their difference (like home editions, enterprise, standard etc) can u please help me
What are inbuilt functions in c?
What is a stream?
which is an algorithm for sorting in a growing Lexicographic order
how to make a scientific calculater ?
WHAT IS THE DEFINATION OF IN TECHNOLOGY AND OFF TECHNOLOGY ?
What is local and global variable in c?
Can you write the function prototype, definition and mention the other requirements.