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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / prasanna

int i,j;
for(i=o;i<4;i++)
{
for(j=0;j<=i;j++)
{
printf("*");
}
}

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More C Interview Questions

what is difference between array of characters and string

18 Answers   Accenture, Nest,


What does *p++ do?

0 Answers  


What are qualifiers in c?

0 Answers  


What is sizeof array in c?

0 Answers  


a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above

0 Answers  






a=10;b= 5;c=3;d=3; if(a printf(%d %d %d %d a,b,c,d) else printf("%d %d %d %d a,b,c,d);

0 Answers   Wilco,


what is the difference between %d and %*d in c languaga?

7 Answers   TCS,


main() { enum{red,green,blue=6,white}; pf("%d%d%d%d", red,green,blue,white); return 0; } a)0 1 6 2 b)0 1 6 7 c)Compilation error d)None of the above

6 Answers  


What are pointers in C?

5 Answers   KPIT,


the expression a=30*1000+2768; evalutes to a) 32768 b) -32768 c) 113040 d) 0

1 Answers  


What does double pointer mean in c?

0 Answers  


Which of the following about the C comments is incorrect ? a.commentscan go over multiple lines b.comments can start any where in the line c.a line can contain comments with out any language statements d.comments can occur within comments

6 Answers   TCS,


Categories