fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. // your code goes here
  6. int n;
  7. cout<<"enter the value of n=";
  8. cin>>n;
  9.  
  10. for(int i=0;i<n+2;i++)
  11. {
  12. for(int k=0;k<n;k++)
  13. {
  14. cout<<"*";
  15. }
  16.  
  17. cout<<endl;
  18. }
  19. return 0;
  20. }
  21.  
Success #stdin #stdout 0.01s 5288KB
stdin
3
stdout
enter the value of n=***
***
***
***
***