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 |
Describe the header file and its usage in c programming?
main() { int arr[5]={23,67}; printf("%d%d%d",arr[2],arr[3],arr[4]); }
Linked list is a Linear or non linear explain if linear how it working as a non linear data structures
Do you know what is a programing language ?
write a program to delete an item from a particular location of an linear array?
What is selection sort in c?
What is macro?
Which control loop is recommended if you have to execute set of statements for fixed number of times?
plz answer.. a program that takes a string e.g. "345" and returns integer 345
Why data types in all programming languages have some range? Why ritche have disigned first time likethat?Why not a single data type can support all other types?
What should be keep precautions while using the recursion method?
what is the advantage of software development