Give the Output :
*
* *
* * *
* * * *

Answer Posted / sakthipriya

#include<stdio.h>
#include<conio.h>
void main()
{
int n=4, c, k, space, count = 1;
space = n;
for ( c = 1 ; c <= n ; c++)
{
for( k = 1 ; k < space ; k++)
printf(" ");
for ( k = 1 ; k <= c ; k++)
{
printf("*");
if ( c > 1 && count < c)
{
printf(" ");
count++;
}
}
printf("\n");
space--;
count = 1;
}
getch();
}

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between struct and typedef struct in c?

663


What is wild pointer in c with example?

583


Is it better to use malloc() or calloc()?

656


List the difference between a While & Do While loops?

641


What is function pointer c?

591






What are the rules for the identifier?

677


What are the different file extensions involved when programming in C?

766


Describe the modifier in c?

610


Q.1 write a program to create binary tree 1 to 16 numbers? Q.2 write a program to creat a binary search tree for the member that is given by user?

2061


What the advantages of using Unions?

677


What is pointer to pointer in c?

638


How can you read a directory in a C program?

658


Explain what is #line used for?

610


How do we open a binary file in Read/Write mode in C?

685


Can we increase size of array in c?

546