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

TURBO C++ help!

Discussion in 'C++' started by xshinichix, Sep 4, 2010.

  1. xshinichix

    xshinichix New Member

    Joined:
    Sep 4, 2010
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    TURBO C ++ HELP! INTERATIVE STATEMENT

    Im a beginner so please help me.

    USING FOR LOOP:

    write a program that will display the following pattern, given the value of n.
    example: of n=4 output:
    1234
    123
    12
    1
     
  2. pankaj.sea

    pankaj.sea New Member

    Joined:
    Apr 6, 2009
    Messages:
    461
    Likes Received:
    13
    Trophy Points:
    0
    Occupation:
    Web Developer
    Location:
    Kolkata
    Home Page:
    see this code
    Code:
    #include<stdio.h>
    #include<conio.h>
    void main()
    {
    int i,j;
    clrscr();
    for(i=0;i<4;i++)
    {
    for(j=0;j<i;j++)
    {
    printf(" *");
    }
    printf("\n");
    }
    for(i=0;i<3;i--);
    {
    for(j=3;j>i;j--);
    {
    ptintf(" *");
    }
    printf("\n");
    }
    getch();
    }
    
    This program is for
    *
    **
    ***
    ****
    ***
    **
    *

    Use this and modify as per requirement.
    :)
     
  3. techgeek.in

    techgeek.in New Member

    Joined:
    Dec 20, 2009
    Messages:
    572
    Likes Received:
    19
    Trophy Points:
    0
    Occupation:
    EOC (exploitation of computers)..i m a Terminator.
    Location:
    Not an alien!! for sure
    Home Page:
    Code:
    # include<stdio.h>
    # include<conio.h>
    
    void main()
    {
    int i,j,n;
    clrscr();
    sacnf("%d",&n);
    for(i=n;i>=1,i--)
    {
    for(j=1;j<=i;i++)
    {
    printf("%d",j);
    }
    printf("/n");
    }
    }
    
     

Share This Page