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
What is volatile, register definition in C
What is structure in c explain with example?
What is pre-emptive data structure and explain it with example?
Why double pointer is used in c?
Write a code to remove duplicates in a string.
Subtract Two Number Without Using Subtraction Operator
What are the scope of static variables?
What is a list in c?
Is array name a pointer?
Are enumerations really portable?
Explain how can I prevent another program from modifying part of a file that I am modifying?
What is a header file?
plz let me know how to become a telecom protocol tester. thank you.
write a program for the normal snake games find in most of the mobiles.
What are the complete rules for header file searching?