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 is this loop always executing once?
How do you determine whether to use a stream function or a low-level function?
a formula,a series of steps,or well defined set of rules for solving a problem a) algorithem b) program c) erdiagram d) compiler
Why doesnt the call scanf work?
A function can make the value of a variable available to another by a) declaring the variable as global variable b) Passing the variable as a parameter to the second function c) Either of the two methods in (A) and (B) d) binary stream
What are the types of assignment statements?
Explain what is the advantage of a random access file?
Differentiate abs() function from fabs() function.
Which of these functions is safer to use : fgets(), gets()? Why?
What are unions in c?
What is d scanf?
Why we use conio h in c?
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
Are there any problems with performing mathematical operations on different variable types?
Why void is used in c?