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 are the benefits of c language?

635


What is typeof in c?

592


Why does everyone say not to use gets?

595


Explain what does it mean when a pointer is used in an if statement?

605


Define recursion in c.

688






What is meant by inheritance?

620


Why should I prototype a function?

624


What is null pointer in c?

579


What is the purpose of 'register' keyword in c language?

610


What is the difference between malloc() and calloc() function in c language?

587


What is the use of pointers in C?

603


What is void pointers in c?

574


Tell us bitwise shift operators?

586


What is scope and lifetime of a variable in c?

562


Explain what math functions are available for integers? For floating point?

598