Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

C++ influenced


c++***parttens;
my name is maheen 
my age is 13 years old
*********************************
#include<iostream>
using namespace std;
int main(){
   int n=5;
   cout<<"enetr a number to draw a dimond...";
   cin>>n;
   int space=n-0;
       
       for(int i=0.i<n;i++){
          
            for(int j=0;j<space;j++){
              cout<<" ";
            }
               for(int j=0;j<=i;j++){
                 cout<<"* ";
               }     
         cout<<endl;
         space--;     
       }
  space=0;
      
      for(int i=n;i>0;i--){
       
         for(int j=0;j<space;j++){
            cout<<" "; 
         }
           for(int j=0;j<i;j++){
            cout<<"* ";    
         }
         cout<<endl;
         space++;
      }
  
  
  
        
}


 
PREVIOUS NEXT
Tagged: #influenced
ADD COMMENT
Topic
Name
8+2 =