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

Name the language in which the compiler of "c" in written?

3 Answers   Bajaj,


Which programming language is best for getting job 2020?

0 Answers  


write C code to reverse a string such that if i/p is "abc defg hij klmno pqrs tuv wxyz" and the o/p should be "cba gfed jih onmlk srqp vut zyxw"

2 Answers  


What is the use of sizeof?

0 Answers  


What is a null pointer assignment error? What are bus errors, memory faults, and core dumps?

0 Answers   Aspire, Infogain,






what is a far pointer

12 Answers   ABB, DRDO, ITI, Maruti Suzuki, Steel Plant, TCS, Toyota, Vivo Mobiles,


hi , please send me NIC written test papers to sbabavalli@gmail.com

0 Answers   NIC,


Differentiate between null and void pointers.

0 Answers   TCS,


Study the code: void show() main() { show(); } void show (char *s) { printf("%sn",s); } What will happen if it is compiled & run on an ANSI C Compiler? A)It will compile & nothing will be printed when it is executed B)it will compile but not link C)the compiler will generate an error D)the compiler will generate a warning

4 Answers   Accenture,


What is a function simple definition?

0 Answers  


What are c identifiers?

0 Answers  


helllo sir , what is the main use of the pointer ,array ,and the structure with the example of a programe

2 Answers  


Categories