Saturday 2 December 2017

Moving triangular pattern with c programming

In this article i am going to show you how you can make this type of moving pattern with c.



What you need for creating this moving pattern.



  • Basic c programming.
  • Text editor like notepad , better if you use Standard code editor and a C compiler.

Some recent post.
1. A animation with html tag used for creating a line and circle
2. New edition of Animation with html and css (line, animate and and css property) - top4ways
3. Animation with html and css (line, animate and and css property) - top4ways


Lets start coding to create this moving triangular pattern.


This is the code for creating moving triangular pattern with c programmig

#include int main(){ 
    int r,c,x,y,s,j;

   for(;;){
         printf("enter a no.");
         scanf("%d",&r);
     
        for(j=1;j<=50;j++){
            for(c=1;c<=r;c++){
                for(s=1;s<=r-c;s++){
                   printf(" "); } y=2*c-1;
           
               for(x=1;x<=y;x++){
                   printf("$"); }
         
             printf("\n");
                     }
                  }
      }
   return 0;
}
Thank You for reading this article and please share your opinion about this and what should i do better for you.

1 comment: