how can i get this by using for loop?
*
**
*
****
*
******
Answers were Sorted based on User's Feedback
Answer / suman_kotte
int i,j;
for(i=1;i<=3;i++)
{
print("*");
print("\n");
for(j=1;j<=i*2;j++)
print("*");
print("\n");
}
Is This Answer Correct ? | 14 Yes | 1 No |
#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 |
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 |
What is p in text message?
Device an algorithm for weiler-atherton polygon clipping, where the clipping window can be any specified polygon
Given an unsigned integer, find if the number is power of 2?
write a programme to enter some number and find which number is maximum and which number is minimum from enterd numbers.
What is s or c?
int i=10; printf("%d %d %d", i, i=20, i);
which operator having lowest precedence?? a.)+ b.)++ c.)= d.)%
I have seen function declarations that look like this
What's the difference between a linked list and an array?
what is disadvantage of pointer in C
what are enumerations in C
What is the modulus operator?