CPP patern

 // A

// B C
// D E F
// G H I J
// K L M N O
// P Q R S T U_________________________________________________________________________

// #include <iostream>
// using namespace std;

// int main()
// {
//     int num;
//     cout << "Enter num :";
//     cin >> num;

//     char ch = 'A';

//     for (int i = 0; i <= num; i++)
//     {

//         // ch = ch + i;
//         for (int j = 1; j <= i; j++)
//         {

//             cout << ch << " ";
//             ch += 1;
//         }
//         cout << endl;
//     }
// }

// A B C D E
// B C D E F
// C D E F G
// D E F G H
// // E F G H I  _____________________________________________

// #include <iostream>
// using namespace std;

// int main()
// {
//     int num;
//     cout << "Enter num :";
//     cin >> num;

//     for (int i = 1; i <= num; i++)
//     {

//         for (int j = 1; j <= i; j++)
//         {
//             char ch = 'A' + i + j - 2;
//             cout << ch << " ";
//         }
//         cout << endl;
//     }
// }

// A B
// C D
// E F
// G H
// I J          __________________________________________________________________

// #include <iostream>
//  using namespace std;

// int main()
// {
//     int num;
//     cout << "Enter num :";
//     cin >> num;
//     char ch = 'A';

//     for (int i = 1; i <= num; i++)
//     {

//         for (int j = 1; j <= 2; j++)
//         {

//             cout << ch << " ";
//             ch += 1;
//         }
//         cout << endl;
//     }
// }

// A
// B B
// C C C
// D D D D
// E E E E E          ________________________________________________________________

// #include <iostream>
// using namespace std;

// int main()
// {
//     int num;
//     cout << "Enter num :";
//     cin >> num;
//     char ch = 'A';

//     for (int i = 1; i <= num; i++)
//     {

//         for (int j = 1; j <= i; j++)
//         {

//             cout << ch << " ";
//         }
//         ch += 1;
//         cout << endl;
//     }
// }

// E
// D D
// C C C
// B B B B
// A A A A A             ____________________________________________________________________

// #include <iostream>
// using namespace std;

// int main()
// {
//     int num;
//     cout << "Enter num :";
//     cin >> num;

//     for (int i = 1; i <= num; i++)
//     {

//         for (int j = 1; j <= i; j++)
//         {
//             char ch = 'A' + num - i;

//             cout << ch << " ";
//         }

//         cout << endl;
//     }
// }

// E
// D  E
// C  D  E
// B  C  D  E
// A  B  C  D  E    ___________________________________________________________________

// #include <iostream>
// using namespace std;

// int main()
// {
//     int num;
//     cout << "Enter num :";
//     cin >> num;

//     for (int i = 1; i <= num; i++)
//     {

//         for (int j = 1; j <= i; j++)
//         {
//             char ch = 'A' - i + j + num - 1;

//             cout << ch << "  ";
//         }

//         cout << endl;
//     }
// }

// 5
// 4  5
// 3  4  5
// 2  3  4  5
// 1  2  3  4  5   ___________________________________________________________

// #include <iostream>
// using namespace std;

// int main()
// {
//     int num;
//     cout << "Enter num :";
//     cin >> num;

//     for (int i = 1; i <= num; i++)
//     {

//         for (int j = 1; j <= i; j++)
//         {
//             int n = -i + j + num;

//             cout << n << "  ";
//         }

//         cout << endl;
//     }
// }

// 1
// 2  1
// 3  2  1
// 4  3  2  1
// 5  4  3  2  1   __________________________________________________________________________

// #include <iostream>
// using namespace std;

// int main()
// {
//     int num;
//     cout << "Enter num :";
//     cin >> num;

//     for (int i = 1; i <= num; i++)
//     {

//         for (int j = 1; j <= i; j++)
//         {
//             int n = i - j + 1;

//             cout << n << "  ";
//         }

//         cout << endl;
//     }
// }

// 1  2  3  4
// 2  3  4  5
// 3  4  5  6
// 4  5  6  7  ________________________________________________________________

// #include <iostream>
// using namespace std;

// int main()
// {
//     int num;
//     cout << "Enter num :";
//     cin >> num;

//     for (int i = 1; i <= num; i++)
//     {

//         for (int j = 1; j <= num; j++)
//         {
//             int n = i + j - 1;

//             cout << n << "  ";
//         }

//         cout << endl;
//     }
// }

// 1
// 2 3
// 3 4 5
// 4 5 6 7
// 5 6 7 8 9              _________________________________________________________________

// #include <iostream>
// using namespace std;

// int main()
// {
//     int num;
//     cout << "Enter num :";
//     cin >> num;

//     for (int i = 1; i <= num; i++)
//     {

//         // int space = num - i;
//         // while (space)
//         // {
//         //     cout << "  ";
//         //     space -= 1;
//         // }

//         for (int sp = num - i; sp >= 0; sp--)
//         {
//             cout << "  ";
//         }

//         for (int j = 1; j <= i; j++)
//         {
//             int n = i + j - 1;

//             cout << n << " ";
//         }
//         cout << endl;
//     }
//

// 1 1 1 1
// 2 2 2
//  3 3
//   4         _______________________________________________________________________

// #include <iostream>
// using namespace std;

// int main()
// {
//     int num;
//     cout << "Enter num :";
//     cin >> num;

//     for (int i = 1; i <= num; i++)
//     {

//         for (int sp = 1; sp <= i; sp++)
//         {
//             cout << "  ";
//         }

//         for (int j = 1; j <= num - i; j++)
//         {
//             int n = i;

//             cout << n << "    ";
//         }
//         cout << endl;
//     }
// }

// 1111
//  222
//   33
//    4          __________________________________________________________________________

// #include <iostream>
// using namespace std;

// int main()
// {
//     int num;
//     cout << "Enter num :";
//     cin >> num;

//     for (int i = 1; i <= num; i++)
//     {

//         for (int sp = 1; sp <= i; sp++)
//         {
//             cout << " ";
//         }

//         for (int j = 1; j <= num - i; j++)
//         {
//             int n = i;

//             cout << n << "";
//         }
//         cout << endl;
//     }
// }

//  1 2 3 4
//   2 3 4
//    3 4
//     4            __________________________________________________________________________________

// #include <iostream>
// using namespace std;

// int main()
// {
//     int num;
//     cout << "Enter num :";
//     cin >> num;

//     for (int i = 1; i <= num; i++)
//     {

//         for (int sp = 1; sp <= i; sp++)
//         {
//             cout << " ";
//         }

//         for (int j = 1; j <= num - i; j++)
//         {
//             int n = i + j - 1;

//             cout << n << " ";
//         }
//         cout << endl;
//     }
// }


//          1
//        1 2 1
//      1 2 3 2 1
//    1 2 3 4 3 2 1

// #include <iostream>
// using namespace std;

// int main()
// {
//     int num;
//     cout << "Enter num :";
//     cin >> num;

//     for (int i = 1; i <= num; i++)
//     {

//         for (int sp = num - i; sp >= 0; sp--)
//         {
//             cout << "  ";
//         }

//         for (int j = 1; j <= i; j++)
//         {
//             int n = j;

//             cout << n << " ";
//         }

//         for (int k = 2; k <= i; k++)
//         {
//             int ans = i - k + 1;
//             cout << ans << " ";
//         }
//         cout << endl;
//     }
// }

Comments

Popular posts from this blog

HERE IS ALL THE C CODE I CREATED

C sum all values output valus using for loop