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 |
can we print any string without using terminator?
What is a structure in c language. how to initialise a structure in c?
What is c definition?
write a c program to remove all the duplicate characters in a string and replace with single character? ex:-input- AAABBBCCC output- ABC
Prove or disprove P!=NP.
What is hash table in c?
what is the other ways to find a logic to print whether a number is an even or odd wit out using % symbol??????? i know three different ways to print it. so i need any other different logic>>>>>
What is the purpose of type declarations?
What is "Hungarian Notation"?
What is the difference between far and near in c?
What is c preprocessor mean?
What is the difference between malloc() and calloc() function in c language?