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
What do you mean by recursion in c?
How can you return multiple values from a function?
List a few unconditional control statement in c.
Can a local variable be volatile in c?
praagnovation
What is the purpose of scanf() and printf() functions?
process by which one bit patten in to another by bit wise operation is? (a) masking, (b) pruning, (c) biting, (d) chopping,
Explain what are binary trees?
Why does the call char scanf work?
In a switch statement, explain what will happen if a break statement is omitted?
How arrays can be passed to a user defined function
Some coders debug their programs by placing comment symbols on some codes instead of deleting it. How does this aid in debugging?
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
When do we get logical errors?
what is bit rate & baud rate? plz give wave forms