Radical Developers welcomes all the visitors to be a member of the team. Come join us. Its all about open-source concept. All Programs are written and tested in MacOS X, Unix, Linux and may not match with the outputs of Turbo C++ in Windows

Sunday, January 9, 2011

Write a program to print the following series :

/*

*
* *
* * *
* * * *

*/

Source Code :

#include<stdio.h>
void main()
{
      int n,i,j;
      clrscr();
      printf("\nEnter Range : ");
      scanf("%d",&n);
      for(i=1;i<=n;i++)
      {
            for(j=1;j<=i;j++)
                  printf("* ");
            printf("\n");
      }
      getch();
}

Output :

Enter Range : 5
*
* *
* * *
* * * *
* * * * *

No comments:

Post a Comment