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 is array within structure?
What are enums in c?
What is volatile variable in c?
Can we declare variable anywhere in c?
Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.
what value is returned to operating system after program execution?
What are the types of functions in c?
Explain the meaning of keyword 'extern' in a function declaration.
write a c program to calculate sum of digits till it reduces to a single digit using recursion
Where in memory are my variables stored?
Differentiate between functions getch() and getche().
Write a program to swap two numbers without using the third variable?
Explain the ternary tree?
What is structure in c definition?
Why is not a pointer null after calling free?