how can i get this by using for loop?
*
**
*
****
*
******
Answer Posted / vignesh1988i
sorry folks, a small mistake in above program , the below is the correct one's...........
#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)
{
printf("*");
for(int j=-2;j<=i;j+=2)
printf("*");
printf("*\n");
}
getch();
}
thank u
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can static variables be declared in a header file?
What is default value of global variable in c?
Differentiate between full, complete & perfect binary trees.
what is the basis for selection of arrays or pointers as data structure in a program
how can I convert a string to a number?
List the different types of c tokens?
Can a pointer be null?
What is context in c?
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
what value is returned to operating system after program execution?
what do you mean by enumeration constant?
What is the function of this pointer?
If a variable is a pointer to a structure, then which operator is used to access data members of the structure through the pointer variable?
What is "Duff's Device"?
hw can we delete an internal node of binary search tree the internal node has child node..plz write progarm