how can i get this by using for loop?
*
**
*
****
*
******

Answer Posted / vignesh1988i

#include<stdio.h>
#include<conio.h>
void main()
{
int m;
clrscr();
printf("enter the lines :");
scanf("%d",&m);
for(int i=1;i<=m;i+=2)
{
for(int j=-2;j<=i;j+=2)
printf("*");
printf("*\n*");
}
getch();
}


thank u

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is volatile, register definition in C

693


What is structure in c explain with example?

645


What is pre-emptive data structure and explain it with example?

3216


Why double pointer is used in c?

573


Write a code to remove duplicates in a string.

633






Subtract Two Number Without Using Subtraction Operator

360


What are the scope of static variables?

607


What is a list in c?

625


Is array name a pointer?

608


Are enumerations really portable?

598


Explain how can I prevent another program from modifying part of a file that I am modifying?

645


What is a header file?

640


plz let me know how to become a telecom protocol tester. thank you.

1745


write a program for the normal snake games find in most of the mobiles.

1789


What are the complete rules for header file searching?

680