Programs for printing pyramid patterns using recursion

22 Oct, 2021
This article is aimed at giving a recursive implementation for pattern printing.
Simple triangle pattern:
C++
Java
Python3
C#
PHP
Javascript
// C++ code to demonstrate star pattern#include <iostream>using namespace std; // function to print a rowvoid printn(int num){    // base case    if (num == 0)        return;    cout << "* ";     // recursively calling printn()    printn(num - 1);} // function to print the patternvoid pattern(int n, int i){    // base case    if (n == 0)        return;    printn(i);    cout << endl;     // recursively calling pattern()    pattern(n - 1, i + 1);} // driver functionint main(){    int n = 5;    pattern(n, 1);    return 0;}
// Java code to demonstrate star patternimport java.io.*; class GFG{     // function to print a rowstatic void printn(int num){    // base case    if (num == 0)        return;    System.out.print ("* ");     // recursively calling printn()    printn(num - 1);} // function to print the patternstatic void pattern(int n, int i){    // base case    if (n == 0)        return;    printn(i);    System.out.println();     // recursively calling pattern()    pattern(n - 1, i + 1);} // Driver codepublic static void main (String[] args){     int n = 5;    pattern(n, 1);}} // This code is contributed by ajit.
# Python3 code to demonstrate star pattern # function to print a rowdef printn(num):         # base case    if (num == 0):        return    print("*", end = " ")     # recursively calling printn()    printn(num - 1) # function to print the patterndef pattern(n, i):         # base case    if (n == 0):        return    printn(i)    print("\n", end = "")         # recursively calling pattern()    pattern(n - 1, i + 1) # Driver Codeif __name__ == '__main__':    n = 5    pattern(n, 1) # This code is contributed by# Surendra_Gangwar
// C# code to demonstrate star patternusing System; class GFG{         // function to print a rowstatic void printn(int num){    // base case    if (num == 0)        return;    Console.Write("* ");     // recursively calling printn()    printn(num - 1);} // function to print the patternstatic void pattern(int n, int i){    // base case    if (n == 0)        return;    printn(i);    Console.WriteLine();     // recursively calling pattern()    pattern(n - 1, i + 1);} // Driver codestatic public void Main (){    int n = 5;    pattern(n, 1);}} // This code is contributed by akt_mit.
<?php// PHP code to demonstrate star pattern // Function to print a rowfunction printn($num){    // base case    if ($num == 0)        return;    echo "* ";     // recursively calling printn()    printn($num - 1);} // function to print the patternfunction pattern($n, $i){    // base case    if ($n == 0)        return;    printn($i);    echo "\n";     // recursively calling pattern()    pattern($n - 1, $i + 1);} // Driver Code$n = 5;pattern($n, 1); // This code is contributed by @Tushil..?>
<script> // JavaScript code to demonstrate star pattern     // function to print a row    function printn(num) {        // base case        if (num == 0)            return;        document.write("* ");         // recursively calling printn()        printn(num - 1);    }     // function to print the pattern    function pattern(n , i) {        // base case        if (n == 0)            return;        printn(i);        document.write("<br/>");         // recursively calling pattern()        pattern(n - 1, i + 1);    }     // Driver code              var n = 5;        pattern(n, 1); // This code is contributed by aashish1995 </script>
* 
* * 
* * * 
* * * * 
* * * * *
 
After 180-degree rotation:
C++
Java
Python3
C#
PHP
Javascript
// C++ code to demonstrate star pattern #include <iostream>using namespace std; // function to print spacesvoid print_space(int space){    // base case    if (space == 0)        return;    cout << " "         << " ";     // recursively calling print_space()    print_space(space - 1);} // function to print asterisksvoid print_asterisk(int asterisk){    // base case    if (asterisk == 0)        return;    cout << "* ";     // recursively calling print_asterisk()    print_asterisk(asterisk - 1);} // function to print the patternvoid pattern(int n, int num){    // base case    if (n == 0)        return;    print_space(n - 1);    print_asterisk(num - n + 1);    cout << endl;     // recursively calling pattern()    pattern(n - 1, num);} // driver functionint main(){    int n = 5;    pattern(n, n);    return 0;}
// Java code to demonstrate star patternimport java.util.*; class GFG{     // function to print spaces    static void print_space(int space)    {        // base case        if (space == 0)        {            return;        }        System.out.print(" " + " ");         // recursively calling print_space()        print_space(space - 1);    }     // function to print asterisks    static void print_asterisk(int asterisk)    {        // base case        if (asterisk == 0)        {            return;        }        System.out.print("* ");         // recursively calling print_asterisk()        print_asterisk(asterisk - 1);    }     // function to print the pattern    static void pattern(int n, int num)    {        // base case        if (n == 0)        {            return;        }        print_space(n - 1);        print_asterisk(num - n + 1);        System.out.println();         // recursively calling pattern()        pattern(n - 1, num);    }     // Driver code    public static void main(String[] args)    {        int n = 5;        pattern(n, n);    }} // This code is contributed by Rajput-Ji
# Python3 code to demonstrate star pattern # function to prspacesdef print_space(space):         # base case    if (space == 0):        return;         print(" ", end=" ");     # recursively calling print_space()    print_space(space - 1); # function to prasterisksdef print_asterisk(asterisk):         # base case    if (asterisk == 0):        return;         print("*", end =" ");     # recursively calling print_asterisk()    print_asterisk(asterisk - 1); # function to print the patterndef pattern(n, num):         # base case    if (n == 0):        return;         print_space(n - 1);    print_asterisk(num - n + 1);    print();     # recursively calling pattern()    pattern(n - 1, num); # Driver codeif __name__ == '__main__':    n = 5;    pattern(n, n);     # This code is contributed by 29AjayKumar
// C# code to demonstrate star patternusing System; class GFG{     // function to print spacesstatic void print_space(int space){    // base case    if (space == 0)        return;    Console.Write(" " + " ");     // recursively calling print_space()    print_space(space - 1);} // function to print asterisksstatic void print_asterisk(int asterisk){    // base case    if (asterisk == 0)        return;    Console.Write("* ");     // recursively calling print_asterisk()    print_asterisk(asterisk - 1);} // function to print the patternstatic void pattern(int n, int num){    // base case    if (n == 0)        return;    print_space(n - 1);    print_asterisk(num - n + 1);    Console.WriteLine();     // recursively calling pattern()    pattern(n - 1, num);} // Driver codepublic static void Main(){    int n = 5;    pattern(n, n);}} // This code is contributed by Akanksha Rai
<?php// PHP code to demonstrate star pattern// function to print spacesfunction print_space($space){    // base case    if ($space == 0)        return;    echo " ",            " ";     // recursively calling print_space()    print_space($space - 1);} // function to print asterisksfunction print_asterisk($asterisk){    // base case    if ($asterisk == 0)        return;    echo "* ";     // recursively calling print_asterisk()    print_asterisk($asterisk - 1);} // function to print the patternfunction pattern($n, $num){    // base case    if ($n == 0)        return;    print_space($n - 1);    print_asterisk(($num - $n) + 1);    echo "\n";     // recursively calling pattern()    pattern($n - 1, $num);} // Driver Code$n = 5;pattern($n, $n); // This code is contributed by @Tushil.?>
<script>// javascript code to demonstrate star pattern     // function to print spaces    function print_space(space) {        // base case        if (space == 0) {            return;        }        document.write(" " + "  ");         // recursively calling print_space()        print_space(space - 1);    }     // function to print asterisks    function print_asterisk(asterisk) {        // base case        if (asterisk == 0) {            return;        }        document.write("* ");         // recursively calling print_asterisk()        print_asterisk(asterisk - 1);    }     // function to print the pattern    function pattern(n , num) {        // base case        if (n == 0) {            return;        }        print_space(n - 1);        print_asterisk(num - n + 1);        document.write("<br/>");         // recursively calling pattern()        pattern(n - 1, num);    }     // Driver code             var n = 5;        pattern(n, n); // This code contributed by aashish1995</script>
        * 
      * * 
    * * * 
  * * * * 
* * * * *
 
Printing Pyramid:
C++
Java
Python3
C#
PHP
Javascript
// C++ code to demonstrate star pattern #include <iostream>using namespace std; // function to print spacesvoid print_space(int space){    // base case    if (space == 0)        return;    cout << " ";     // recursively calling print_space()    print_space(space - 1);} // function to print asterisksvoid print_asterisk(int asterisk){    // base case    if (asterisk == 0)        return;    cout << "* ";     // recursively calling asterisk()    print_asterisk(asterisk - 1);} // function to print the patternvoid pattern(int n, int num){    // base case    if (n == 0)        return;    print_space(n - 1);    print_asterisk(num - n + 1);    cout << endl;     // recursively calling pattern()    pattern(n - 1, num);} // driver functionint main(){    int n = 5;    pattern(n, n);    return 0;}
// Java code to demonstrate star patternimport java.util.*; class GFG{ // function to print spacesstatic void print_space(int space){    // base case    if (space == 0)        return;    System.out.print(" ");     // recursively calling print_space()    print_space(space - 1);} // function to print asterisksstatic void print_asterisk(int asterisk){    // base case    if (asterisk == 0)        return;    System.out.print("* ");     // recursively calling asterisk()    print_asterisk(asterisk - 1);} // function to print the patternstatic void pattern(int n, int num){    // base case    if (n == 0)        return;    print_space(n - 1);    print_asterisk(num - n + 1);    System.out.println("");     // recursively calling pattern()    pattern(n - 1, num);} // Driver codepublic static void main(String[] args){    int n = 5;    pattern(n, n);}} // This code is contributed by 29AjayKumar
# Python3 code to demonstrate star pattern # function to print spacesdef print_space(space):         # base case    if (space == 0):        return;    print(" ", end = "");     # recursively calling print_space()    print_space(space - 1); # function to print asterisksdef print_asterisk(asterisk):         # base case    if(asterisk == 0):        return;    print("* ", end = "");     # recursively calling asterisk()    print_asterisk(asterisk - 1); # function to print the patterndef pattern(n, num):         # base case    if (n == 0):        return;    print_space(n - 1);    print_asterisk(num - n + 1);    print("");     # recursively calling pattern()    pattern(n - 1, num); # Driver Coden = 5;pattern(n, n); # This code contributed by PrinciRaj1992
// C# code to demonstrate star patternusing System; class GFG{ // function to print spacesstatic void print_space(int space){    // base case    if (space == 0)        return;    Console.Write(" ");     // recursively calling print_space()    print_space(space - 1);} // function to print asterisksstatic void print_asterisk(int asterisk){    // base case    if (asterisk == 0)        return;    Console.Write("* ");     // recursively calling asterisk()    print_asterisk(asterisk - 1);} // function to print the patternstatic void pattern(int n, int num){    // base case    if (n == 0)        return;    print_space(n - 1);    print_asterisk(num - n + 1);    Console.WriteLine("");     // recursively calling pattern()    pattern(n - 1, num);} // Driver codepublic static void Main(String[] args){    int n = 5;    pattern(n, n);}} // This code is contributed by 29AjayKumar
<?php// PHP code to demonstrate star pattern // function to print spacesfunction print_space($space){    // base case    if ($space == 0)        return;    echo " ";     // recursively calling print_space()    print_space($space - 1);} // function to print asterisksfunction print_asterisk($asterisk){    // base case    if ($asterisk == 0)        return;    echo "* ";     // recursively calling asterisk()    print_asterisk($asterisk - 1);} // function to print the patternfunction pattern($n, $num){    // base case    if ($n == 0)        return;    print_space($n - 1);    print_asterisk($num - $n + 1);    echo "\n";     // recursively calling pattern()    pattern($n - 1, $num);} // Driver code    $n = 5;    pattern($n, $n);     // This code is contributed by ajit.?>
<script> // JavaScript code to demonstrate star pattern // function to print spacesfunction print_space(space){    // base case    if (space == 0)        return;    document.write(" ");      // recursively calling print_space()    print_space(space - 1);} // function to print asterisksfunction print_asterisk(asterisk){    // base case    if (asterisk == 0)        return;    document.write("* ");      // recursively calling asterisk()    print_asterisk(asterisk - 1);} // function to print the patternfunction pattern(n,num){    // base case    if (n == 0)        return;    print_space(n - 1);    print_asterisk(num - n + 1);    document.write("<br>");      // recursively calling pattern()    pattern(n - 1, num);} // Driver codelet n = 5;pattern(n, n);  // This code is contributed by rag2127 </script>
    * 
   * * 
  * * * 
 * * * * 
* * * * *
 
Number Pattern
C++
Java
Python3
C#
PHP
Javascript
// C++ code to demonstrate printing pattern of numbers #include <iostream>using namespace std; // function to print a rowvoid print_row(int no, int val){    // base case    if (no == 0)        return;    cout << val << " ";     // recursively calling print_row()    print_row(no - 1, val);} // function to print the patternvoid pattern(int n, int num){    // base case    if (n == 0)        return;    print_row(num - n + 1, num - n + 1);    cout << endl;     // recursively calling pattern()    pattern(n - 1, num);}int main(){    int n = 5;    pattern(n, n);}
// Java code to demonstrate printing// pattern of numbersclass GFG{     // function to print a rowstatic void print_row(int no, int val){    // base case    if (no == 0)        return;    System.out.print(val + " ");     // recursively calling print_row()    print_row(no - 1, val);} // function to print the patternstatic void pattern(int n, int num){    // base case    if (n == 0)        return;    print_row(num - n + 1, num - n + 1);    System.out.println();     // recursively calling pattern()    pattern(n - 1, num);} // Driver Codepublic static void main(String[] args){    int n = 5;    pattern(n, n);}} // This code is contributed by Code_Mech.
# Python3 code to demonstrate printing# pattern of numbers # function to print a rowdef print_row(no, val):         # base case    if (no == 0):        return;    print(val , end=" ");     # recursively calling print_row()    print_row(no - 1, val); # function to print the patterndef pattern(n, num):    # base case    if (n == 0):        return;    print_row(num - n + 1, num - n + 1);    print("");     # recursively calling pattern()    pattern(n - 1, num); # Driver Coden = 5;pattern(n, n); # This code contributed by PrinciRaj1992
// C# code to demonstrate printing// pattern of numbersusing System; class GFG{     // function to print a rowstatic void print_row(int no, int val){    // base case    if (no == 0)        return;    Console.Write(val + " ");     // recursively calling print_row()    print_row(no - 1, val);} // function to print the patternstatic void pattern(int n, int num){    // base case    if (n == 0)        return;    print_row(num - n + 1, num - n + 1);    Console.WriteLine();     // recursively calling pattern()    pattern(n - 1, num);} // Driver Codepublic static void Main(){    int n = 5;    pattern(n, n);}} // This code is contributed by Akanksha Rai
<?php// PHP code to demonstrate printing// pattern of numbers // function to print a rowfunction print_row($no, $val){    // base case    if ($no == 0)        return;    echo $val . " ";     // recursively calling print_row()    print_row($no - 1, $val);} // function to print the patternfunction pattern($n, $num){    // base case    if ($n == 0)        return;    print_row($num - $n + 1,              $num - $n + 1);    echo "\n";     // recursively calling pattern()    pattern($n - 1, $num);} // Driver Code$n = 5;pattern($n, $n); // This code is contributed// by Akanksha Rai?>
<script>       // JavaScript code to demonstrate      // printing pattern of numbers       // function to print a row      function print_row(no, val) {               // base case        if (no == 0) return;        document.write(val + "  ");         // recursively calling print_row()        print_row(no - 1, val);      }       // function to print the pattern      function pattern(n, num) {                 // base case        if (n == 0) return;        print_row(num - n + 1, num - n + 1);        document.write("<br>");         // recursively calling pattern()        pattern(n - 1, num);      }       var n = 5;      pattern(n, n);           </script>
1 
2 2 
3 3 3 
4 4 4 4 
5 5 5 5 5
 
Numbers without reassigning:
C++
Java
Python3
C#
Javascript
// C++ code to demonstrate printing pattern of numbers #include <iostream>using namespace std; // function to print a rowint print_row(int ct, int num){    // base case    if (num == 0)        return ct;    cout << ct << "\t";     // recursively calling print_row()    print_row(ct + 1, num - 1);} // function to print the patternvoid pattern(int n, int count, int num){    // base case    if (n == 0)        return;    count = print_row(count, num);    cout << endl;     // recursively calling pattern()    pattern(n - 1, count, num + 1);} // driver functionint main(){    int n = 5;    pattern(n, 1, 1);}
// Java code to demonstrate// printing pattern of numbersimport java.io.*; class GFG{     // function to print a rowstatic int print_row(int ct, int num){    // base case    if (num == 0)        return ct;            System.out.print(ct + "  ");     // recursively calling print_row()    return print_row(ct + 1, num - 1);} // function to print the patternstatic void pattern(int n,                    int count, int num){    // base case    if (n == 0)        return;    count = print_row(count, num);            System.out.println();     // recursively calling pattern()    pattern(n - 1, count, num + 1);} // Driver Codepublic static void main (String[] args){    int n = 5;    pattern(n, 1, 1);}} // This code is contributed by Tushil
# Python3 code to demonstrate# printing pattern of numbers # function to pra rowdef print_row(ct, num):         # base case    if (num == 0):        return ct;    print(ct, end = " ");     # recursively calling print_row()    return print_row(ct + 1, num - 1); # function to print the patterndef pattern(n, count, num):         # base case    if (n == 0):        return;    count = print_row(count, num);    print();     # recursively calling pattern()    pattern(n - 1, count, num + 1); # Driver Codeif __name__ == '__main__':    n = 5;    pattern(n, 1, 1); # This code is contributed by 29AjayKumar
// C# code to demonstrate// printing pattern of numbersusing System; class GFG{ // function to print a rowstatic int print_row(int ct, int num){    // base case    if (num == 0)        return ct;    Console.Write (ct + "  ");     // recursively calling print_row()    return print_row(ct + 1, num - 1);} // function to print the patternstatic void pattern(int n,                    int count, int num){    // base case    if (n == 0)        return;    count = print_row(count, num);    Console.WriteLine();     // recursively calling pattern()    pattern(n - 1, count, num + 1);} // Driver Codestatic public void Main (){    int n = 5;    pattern(n, 1, 1);}} // This code is contributed by ajit
<script> // Javascript code to demonstrate// printing pattern of numbers // Function to print a rowfunction print_row(ct, num){         // Base case    if (num == 0)        return ct;             document.write(ct + "   ");     // Recursively calling print_row()    return print_row(ct + 1, num - 1);} // Function to print the patternfunction pattern(n, count, num){         // Base case    if (n == 0)        return;             count = print_row(count, num);    document.write("<br/>");     // Recursively calling pattern()    pattern(n - 1, count, num + 1);} // Driver Codevar n = 5; pattern(n, 1, 1); // This code is contributed by aashish1995 </script>
1    
2    3    
4    5    6    
7    8    9    10    
11    12    13    14    15
 
Character Pattern:
C++
Java
Python3
C#
Javascript
// C++ code to demonstrate printing pattern of alphabets #include <iostream>using namespace std; // function to print a rowvoid print_row(int no, int val){    // base case    if (no == 0)        return;    cout << (char)(val + 64) << " ";     // recursively calling print_row()    print_row(no - 1, val);} // function to print the patternvoid pattern(int n, int num){    // base case    if (n == 0)        return;    print_row(num - n + 1, num - n + 1);    cout << endl;     // recursively calling pattern()    pattern(n - 1, num);}int main(){    int n = 5;    pattern(n, n);}
// Java code to demonstrate printing pattern of alphabetsclass GFG{ // function to print a rowstatic void print_row(int no, int val){    // base case    if (no == 0)        return;    System.out.print((char)(val + 64) + " ");     // recursively calling print_row()    print_row(no - 1, val);} // function to print the patternstatic void pattern(int n, int num){    // base case    if (n == 0)        return;    print_row(num - n + 1, num - n + 1);    System.out.println();     // recursively calling pattern()    pattern(n - 1, num);} // Driver codepublic static void main(String[] args){    int n = 5;    pattern(n, n);}} // This code is contributed by Rajput-Ji
# Python3 code to demonstrate printing pattern of alphabets  # function to pra rowdef print_row(no, val):    # base case    if (no == 0):        return;    print(chr(val + 64), end=" ");     # recursively calling print_row()    print_row(no - 1, val);  # function to print the patterndef pattern(n, num):    # base case    if (n == 0):        return;    print_row(num - n + 1, num - n + 1);    print();     # recursively calling pattern()    pattern(n - 1, num);  # Driver codeif __name__ == '__main__':    n = 5;    pattern(n, n); # This code is contributed by 29AjayKumar
// C# code to demonstrate printing pattern of alphabetsusing System; class GFG{ // function to print a rowstatic void print_row(int no, int val){    // base case    if (no == 0)        return;    Console.Write((char)(val + 64) + " ");     // recursively calling print_row()    print_row(no - 1, val);} // function to print the patternstatic void pattern(int n, int num){    // base case    if (n == 0)        return;    print_row(num - n + 1, num - n + 1);    Console.WriteLine();     // recursively calling pattern()    pattern(n - 1, num);} // Driver codepublic static void Main(String[] args){    int n = 5;    pattern(n, n);}} // This code is contributed by 29AjayKumar
<script>    // Javascript code to demonstrate printing pattern of alphabets         // function to print a row    function print_row(no, val)    {        // base case        if (no == 0)            return;        document.write(String.fromCharCode(val + 64) + " ");         // recursively calling print_row()        print_row(no - 1, val);    }     // function to print the pattern    function pattern(n, num)    {        // base case        if (n == 0)            return;        print_row(num - n + 1, num - n + 1);        document.write("</br>");         // recursively calling pattern()        pattern(n - 1, num);    }         let n = 5;    pattern(n, n); </script>
A 
B B 
C C C 
D D D D 
E E E E E
 
Continuous Character pattern:  
C++
Java
Python3
C#
Javascript
#include <iostream>using namespace std; // function to print a rowint print_row(int ct, int num){    // base case    if (num == 0)        return ct;    cout << (char)(ct + 64) << " ";     // recursively calling print_row()    print_row(ct + 1, num - 1);} // function to print the patternvoid pattern(int n, int count, int num){    // base case    if (n == 0)        return;    count = print_row(count, num);    cout << endl;     // recursively calling pattern()    pattern(n - 1, count, num + 1);} // driver functionint main(){    int n = 5;    pattern(n, 1, 1);}
class GFG{ // function to print a rowstatic int print_row(int ct, int num){    // base case    if (num == 0)        return ct;    System.out.print((char)(ct + 64) + " ");     // recursively calling print_row()    print_row(ct + 1, num - 1);    return num + ct;     } // function to print the patternstatic void pattern(int n, int count, int num){    // base case    if (n == 0)        return;    count = print_row(count, num);    System.out.println();     // recursively calling pattern()    pattern(n - 1, count, num + 1);} // Driver codepublic static void main(String[] args){    int n = 5;    pattern(n, 1, 1);}} // This code is contributed by 29AjayKumar
# function to print rowdef print_row(ct, num):         # base case    if (num == 0):        return ct;    print(chr(ct + 64), end=" ");     # recursively calling print_row()    print_row(ct + 1, num - 1);    return num + ct; # function to print the patterndef pattern(n, count, num):     # base case    if (n == 0):        return;    count = print_row(count, num);    print();     # recursively calling pattern()    pattern(n - 1, count, num + 1); # Driver codeif __name__ == '__main__':    n = 5;    pattern(n, 1, 1); # This code is contributed by Rajput-Ji
using System; class GFG{ // function to print a rowstatic int print_row(int ct, int num){    // base case    if (num == 0)        return ct;    Console.Write((char)(ct + 64) + " ");     // recursively calling print_row()    print_row(ct + 1, num - 1);    return num + ct; } // function to print the patternstatic void pattern(int n, int count, int num){    // base case    if (n == 0)        return;    count = print_row(count, num);    Console.WriteLine();     // recursively calling pattern()    pattern(n - 1, count, num + 1);} // Driver codepublic static void Main(String[] args){    int n = 5;    pattern(n, 1, 1);}} // This code is contributed by 29AjayKumar
<script>    // function to print a rowfunction print_row( ct,  num){    // base case    if (num == 0)        return ct;    document.write(String.fromCharCode(ct + 64) + " ");      // recursively calling print_row()    print_row(ct + 1, num - 1);    return num + ct;  }  // function to print the patternfunction pattern( n,  count,  num){    // base case    if (n == 0)        return;    count = print_row(count, num);    document.write("<br>");      // recursively calling pattern()    pattern(n - 1, count, num + 1);}  // Driver code     var n = 5;    pattern(n, 1, 1);</script>
A 
B C 
D E F 
G H I J 
K L M N O
 
 
 
jit_t
SURENDRA_GANGWAR
Akanksha_Rai
Code_Mech
Rajput-Ji
29AjayKumar
princiraj1992
aashish1995
rdtank
bunnyram19
divyesh072019
rag2127
simranarora5sos
pattern-printing
C++ Programs
Recursion
School Programming
pattern-printing
Recursion
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Shallow Copy and Deep Copy in C++
C++ Program to check if a given String is Palindrome or not
How to find the minimum and maximum element of a Vector using STL in C++?
C++ Program for QuickSort
C Program to Swap two Numbers
Write a program to print all permutations of a given string
Given an array A[] and a number x, check for pair in A[] with sum as x (aka Two Sum)
Recursion
Program for Tower of Hanoi
Backtracking | Introduction