Thread: Digits pyramid printing programs needed in C Programming

  1. #1
    Registered User technoexam's Avatar
    Join Date
    May 2011
    Location
    India
    Posts
    8

    Exclamation Digits pyramid printing programs needed in C Programming

    write a program that prints the following pattern
    Code:
            5
                             4 5 4
                          3 4 5 4 3
                       2 3 4 5 4 3 2 
                    1 2 3 4 5 4 3 2 1
    Last edited by technoexam; 10-01-2011 at 12:36 PM.

  2. #2
    Registered User
    Join Date
    Nov 2010
    Location
    Long Beach, CA
    Posts
    5,909
    Ok. Done.

    Now it's my turn: Read the homework policy and forum guidelines. Make an effort on your problem, post your code in code tags, and ask a specific question. Then you might get a real answer, instead of some smart a s s response.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    @technoexam
    You really ought to take your website off-line until you actually know something about the subject.
    It is obsolete and wrong in pretty much equal measure.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by technoexam View Post
    write a program that prints the following pattern
    ..No.. I don't want to.


    EDIT: Salem... you're right... the code and information on that website is way out of date...

  5. #5
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    It's perfectly logical for the backwards-azz plurality (at least) of developers in his native country.

  6. #6
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    Quote Originally Posted by rags_to_riches View Post
    It's perfectly logical for the backwards-azz plurality (at least) of developers in his native country.
    Sadly, he might even be seen as a teacher or benefactor over there....

  7. #7
    [](){}(); manasij7479's Avatar
    Join Date
    Feb 2011
    Location
    *nullptr
    Posts
    2,657
    Quote Originally Posted by rags_to_riches View Post
    It's perfectly logical for the backwards-azz plurality (at least) of developers in his native country.
    Quote Originally Posted by CommonTater
    Sadly, he might even be seen as a teacher or benefactor over there....
    Just because of a few... err.. few thousand trolls... you can't say that !!
    There are plenty of people here left on the light side of the force .

  8. #8
    Banned
    Join Date
    Aug 2010
    Location
    Ontario Canada
    Posts
    9,547
    @Monasij... No argument, there's plenty of smart and modern people in India...
    However, that doesn't mean the backwards ones get a free pass.

    As they say: "Corruption exists only by grace of silence from the masses."

  9. #9
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    Quote Originally Posted by technoexam View Post
    write a program that prints the following pattern
    Code:
            5
                             4 5 4
                          3 4 5 4 3
                       2 3 4 5 4 3 2 
                    1 2 3 4 5 4 3 2 1
    I know, I know, I shouldn't give out free code. I just can't help myself today.
    Code:
    #include<stdio.h>
    int main( void )
    {
        printf(
    "5\n"\
    "                         4 5 4\n"\
    "                      3 4 5 4 3\n"\
    "                   2 3 4 5 4 3 2 \n"\
    "                1 2 3 4 5 4 3 2 1\n"
        );
        return 0;
    }

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C Programming Help - 'return' & digits in a number
    By jamestgarner in forum C Programming
    Replies: 12
    Last Post: 10-11-2006, 02:27 AM
  2. Printing a specific number of digits
    By JizJizJiz in forum C++ Programming
    Replies: 4
    Last Post: 06-28-2006, 08:14 PM
  3. What software is needed to write internet based gaming programs
    By grumpomatic in forum Game Programming
    Replies: 8
    Last Post: 11-26-2005, 10:49 PM
  4. Printing 2 digits
    By sjalesho in forum C Programming
    Replies: 2
    Last Post: 11-02-2003, 03:14 PM
  5. help on console programs needed
    By thrice in forum C++ Programming
    Replies: 2
    Last Post: 07-26-2003, 05:32 PM