code snippet for creating a pyramids triangle
ex
1
2 2
3 3 3
Answer Posted / k
#include<iostream.h>
int main()
{int i,j,k;
for(i=1;i<=3;i++)
{cout<<"\n";
for(j=1;j<=3-i;j++)
cout<<" ";
for(k=i;k>0;k--)
cout<<i<<" ";
}
return 0;
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Post New Answer View All Answers
What does %2f mean in c?
What is a built-in function in C?
Write a program to check prime number in c programming?
What is openmp in c?
Differentiate Source Codes from Object Codes
Is c++ based on c?
Differentiate between the = symbol and == symbol?
Define macros.
Can you return null in c?
What is file in c preprocessor?
Explain how can I right-justify a string?
Which is the best website to learn c programming?
how to write optimum code to divide a 50 digit number with a 25 digit number??
The difference between printf and fprintf is ?
Is main is a keyword in c?