TheDeveloperBlog.com

Home | Contact Us

C-Sharp | Java | Python | Swift | GO | WPF | Ruby | Scala | F# | JavaScript | SQL | PHP | Angular | HTML

Program to Print Pattern 14

Program to Print Pattern 14 on fibonacci, factorial, prime, armstrong, swap, reverse, search, sort, stack, queue, array, linkedlist, tree, graph, pattern, string etc.

<< Back to PROGRAM

Program to print the following pattern

Program to print the following pattern
Program to print the following pattern

Algorithm

  1. Start
  2. Let i be an integer number.
  3. Let j be an integer number.
  4. Let size be an integer number and initialize by 6.
  5. Repeat step 6 to 10 until all value parsed.
  6. Set i = size and check I != 0;
  7. Set j = 0 and check j <= size-i;
  8. Print space.
  9. Set k = 0 and check k <= 2*i-1;
  10. Print star symbol.
  11. End

JAVA

public class Pattern12 
{
    public static void main(String[] args) 
    {
        int size ;
        size =6;
        for (int i = size; i != 0; i--) 
        {
            for (int j = 0; j<size-i; j++)
            {
                System.out.print(" ");
            }
            for (int k = 00; k < (2 * i - 1); k++) 
            {
                System.out.print("*");
            }
            System.out.println();
    }
    }
}

Python

i=1
for j in range(11,0,-2):
    print(i*' '+j*'*')
    i = i+1

C program

#include <stdio.h>
int main()
{
int size = 6;
for (int i = size; i != 0; i--) 
{
    for (int j = 0; j<size-i; j++)
            {
                printf(" ");
            }
    for (int k = 0; k < (2 * i - 1); k++) 
            {
		printf("*");
            }
    printf("\n");       
    }
}

C# program

using System;
public class Program
{
public static void Main()
{
int num, i, k, count = 1;
num=7;
for (k = 1; k <= num - 1; k++)
{
for (i = 1; i <= count; i++)
Console.Write(" ");
count++;
for (i = 1; i <= 2 * (num - k) - 1; i++)
Console.Write("*");
Console.WriteLine();
}
Console.ReadLine();
}
}

PHP program

<?php

for($i=9;$i>=1;$i--){
 
    for ($d=0; $d <= 9-$i; $d++)  {
        echo "  ";
    }
     
    for($j=$i;$j>=1;$j--){
        echo "�"."* �";
    }
    echo "<br>";
  }
?>





Related Links:


Related Links

Adjectives Ado Ai Android Angular Antonyms Apache Articles Asp Autocad Automata Aws Azure Basic Binary Bitcoin Blockchain C Cassandra Change Coa Computer Control Cpp Create Creating C-Sharp Cyber Daa Data Dbms Deletion Devops Difference Discrete Es6 Ethical Examples Features Firebase Flutter Fs Git Go Hbase History Hive Hiveql How Html Idioms Insertion Installing Ios Java Joomla Js Kafka Kali Laravel Logical Machine Matlab Matrix Mongodb Mysql One Opencv Oracle Ordering Os Pandas Php Pig Pl Postgresql Powershell Prepositions Program Python React Ruby Scala Selecting Selenium Sentence Seo Sharepoint Software Spellings Spotting Spring Sql Sqlite Sqoop Svn Swift Synonyms Talend Testng Types Uml Unity Vbnet Verbal Webdriver What Wpf