1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

problem with while program logic

Discussion in 'C' started by shakir1, Nov 3, 2009.

  1. shakir1

    shakir1 New Member

    Joined:
    Oct 12, 2009
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    hi, every body i want to know the logic that how to get output in C, of stars like

    *
    **
    ***
    ****
    *****
    ******
    using while loop

    thanks for help me.
     
  2. NewsBot

    NewsBot New Member

    Joined:
    Dec 2, 2008
    Messages:
    1,267
    Likes Received:
    2
    Trophy Points:
    0
    Any trial you would like to share
     
  3. rohitphulsunge

    rohitphulsunge New Member

    Joined:
    Jan 11, 2010
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    0
    Location:
    Nagpur, Maharashtra, India
    Rohit Phulsunge says-

    Code:
    #include<stdio.h>
    #include<conio.h>
    void main()
    {     
         clrscr();
         int i=1,j=0,k; 
          while(i!=6)
             {j=1;
              while(j!=i)
               {
               printf("*");
              j++; 
              }
               i++;
              printf("\n");
             }
           getch();
         }
                      
    //End of Program code.
     

Share This Page