public class StarPyramid
{
public static void main(String [] args)
{
int space = 0, line = 0, star = 0;
for(line = 1; line <= 26; line ++)
{
for(space = 26; space > line; space--)
{
System.out.print(" "); // Display one space
}
for(star = 1; star < line; star++)
{
System.out.print("*‟);
}
for(star = line; star >= 1; star--)
{
System.out.print("*‟);
}
System.out.println(); // Display new line with ln
}
}
}
Here's a simple Python program that constructs and displays a pyramid: def print_pyramid(height): for i in range(height): print(' ' * (height - i - 1) + '*' * (2 * i + 1)) print_pyramid(5) This code defines a function print_pyramid that takes the height of the pyramid as an argument and prints a pyramid made of asterisks (*). Adjust the height parameter in the print_pyramid function call to change the size of the pyramid.
i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?
echo 'print a pattern'
Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.
printf ("initials");
To print the given pyramid pattern in C, you can use nested loops. The outer loop controls the rows, and the inner loop controls the numbers to be printed in each row. Here's a simple C program to achieve this: #include <stdio.h> int main() { int rows = 5; for (int i = 1; i <= rows; i++) { for (int j = 1; j <= i; j++) { printf("%d", j); } for (int j = i - 1; j >= 1; j--) { printf("%d", j); } printf("\n"); } return 0; } This program will output the desired pyramid pattern.
With a nested loop this is fairly simple. Example, in Java: for (int i = 1; i
i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?
hi question is here, 1 1 2 1 2 3 1 2 3 4
echo 'print a pattern'
write a program to print A to Z on screen in c?
Print Server
To print out Christmas card is simple. You need cardstock and a printer attached to your computer. You can create cards of your own with a Word or card program you may have installed on your computer or go to a website such as Ecards.
print it how you normally would and then staple it together.. simple
Use the option File / Print in the program you are using.
Select the answer, copy and paste into a word processing program, and print as you would print any other document.
If your screen does not give you an option to Print then save the document to a word program and print from there.