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
why do some people write if(0 == x) instead of if(x == 0)?
Write a program for Overriding.
Is null a keyword in c?
When a c file is executed there are many files that are automatically opened what are they files?
How many keywords (reserve words) are in c?
Do pointers take up memory?
Explain the meaning of keyword 'extern' in a function declaration.
Explain how do you list a file’s date and time?
How to implement a packet in C
Why use int main instead of void main?
What is the difference between array and structure in c?
Do string constants represent numerical values?
Explain what is the difference between functions abs() and fabs()?
Why we use void main in c?
Explain how do you declare an array that will hold more than 64kb of data?