Pages

Wednesday, March 26, 2025

Print square patterns using for loop in C++

 #include <iostream>

using namespace std;
int main(){
   
    for(int i = 1; i <= 5; i++){

        cout << "****" << endl;

        /* MyLearnings:- cout << i << "****" << endl; -> this will print value of i +patterns
so keep in mind. */
    }

    return 0;
}


No comments:

Post a Comment

3Sum - Leetcode solution - How i turned into two-pointer approach?

  class Solution {     public List < List < Integer >> threeSum ( int [] nums ) {         Arrays . sort (nums); // first sort...