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
Tell us two differences between new () and malloc ()?
Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?
Differentiate between calloc and malloc.
On most computers additional memory that is accessed through an adapter of feature card along with a device driver program. a) user memory b) conventional memory c) expandedmemory d) area
What is c value paradox explain?
Write a program to replace n bits from the position p of the bit representation of an inputted character x with the one's complement. Method invertBit takes 3 parameters x as input character, p as position and n as the number of positions from p. Replace n bits from pth position in 8 bit character x. Then return the characters by inverting the bits.
What do you mean by a local block?
Explain how can I pad a string to a known length?
What is structure padding in c?
What is the purpose of scanf() and printf() functions?
Why c is a procedural language?
What are the 4 types of programming language?
Why pointers are used in c?
What is the main difference between calloc () and malloc ()?
What is use of #include in c?