Step 4. Click on the Save Template button To make this youtube playlist work we need to add the HTML structure of it: Step 5. Go to Layout or Pages or anywhere you want to add it and add the following code inside the HTML area (if you want to add it as a widget, paste the code inside a HTML/Javascript gadget by clicking on Add a gadget link within the Layout/Page Elements section):

Search This Blog

Follow me on Facebook

Print a diamond in C using for loop

      Print a Diamond in C using for loop

 int n, nol,spaces,stars;            //nol=number of lines
       printf("Enter the radius of the Diamond\n");
       scanf("%d" , &n);
       for(nol=1; nol<=n; nol++)
       {
              for(spaces=n-1; spaces>=nol; spaces--)
              {
                     printf(" ");
              }
              for(stars=1; stars<=nol; stars++)
              {
                     printf("*");
                     printf(" ");
              }
              printf("\n");
       }

       for(nol=1; nol<=n; nol++)
       {
              for(spaces=1; spaces<=nol; spaces++)
              {
                     printf(" ");
              }
              for(stars=n-1; stars>=nol; stars--)
              {
                     printf("*");
                  printf(" ");
              }

              printf("\n");
       }
       return 0;

}     

diamond in c using foor loop