what is the code for getting the output as
*
**
***




Answers were Sorted based on User's Feedback



what is the code for getting the output as * ** ..

Answer / babitha

# include <Stdio.h>
# include <conio.h>
# include <string.h>

void main()
{
int j,i,n;

scanf("%d",&n);

for (i=0;i<=n;i++)
{
for(j=0;j<i;j++)
printf("*");
printf("\n");
}

getch();

}

Is This Answer Correct ?    6 Yes 1 No

what is the code for getting the output as * ** ..

Answer / gg

#include<stdio.h>
main()
{
int n,i=0,j=0;
printf("Enter an intger : ");//upto n nof *'s
scanf("%d",&n);
while(j<n)
{
for(i=0;i<=j;printf("*"),i++);
printf("\n",j++);
}
}

Is This Answer Correct ?    2 Yes 0 No

what is the code for getting the output as * ** ..

Answer / anvesh

main()
{
printf("*\n**\n***);
}
OR
main()
{
int n,i;
while(n<3)
{
i=0;
while(i<=n)
{printf("*");i++;}
printf("\n); n++;
}

Is This Answer Correct ?    4 Yes 3 No




what is the code for getting the output as * ** ..

Answer / sourisengupta

void main()
{
int i,j;
for(i=0;i<3;i++){
for(j=0;j<i;j++){
printf("*");
printf("\n");
}
}
}

Is This Answer Correct ?    0 Yes 3 No

what is the code for getting the output as * ** ..

Answer / pooja sonawane

void main()
{
int i,j;
for(i=0;i<3;i++)
printf("\n");
for(j=0;j<i;j++)
printf("*");
}

Is This Answer Correct ?    2 Yes 6 No

Post New Answer



More C Interview Questions

a single linked list consists of nodes a to z .print the nodes in reverse order from z to a using recursion

0 Answers   Mindteck,


While compiling a c program,graphics header files are not including in my program..eg: <graphics.h>,what may be the problem...is there any environment settings exists.

2 Answers  


advantages of pointers?

3 Answers  


Write a program in C to convert date displayed in gregorian to julian date

0 Answers   Wipro, HCL,


difference between object file and executable file

0 Answers  






main() { int i; printf("%d",i^i); }

1 Answers  


Taking an example,differentiate b/w loader and linker ?

1 Answers  


what do u mean by Direct access files? then can u explain about Direct Access Files?

0 Answers   LG Soft,


A program to allow an input operand and operator from the operator and read on the display and output operand.

0 Answers  


typedef struct { int i:8; char c:9; float f:20; }st_temp; int getdata(st_temp *stptr) { stptr->i = 99; return stptr->i; } main() { st_temp local; int i; local.c = 'v'; local.i = 9; local.f = 23.65; printf(" %d %c %f",local.i,local.c,local.f); i = getdata(&local); printf("\n %d",i); getch(); } why there there is an error during compiling the above program?

1 Answers  


write a program without using main function?

2 Answers   TCS,


can we define a function in structure?

2 Answers  






Categories