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 are the data types present in c?
How can a string be converted to a number?
Can a function be forced to be inline? Also, give a comparison between inline function and the C macro?
What is calloc malloc realloc in c?
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
Difference between malloc() and calloc() function?
Where static variables are stored in memory in c?
A global variable when referred to in another file is declared as this a) local variable b) external variable c) constant d) pointers
What are the different types of linkage exist in c?
How are pointers declared in c?
i have a written test for microland please give me test pattern
What is main function in c?
What does it mean when a pointer is used in an if statement?
How can I direct output to the printer?
What is conio h in c?