Thread: give me some idea..

  1. #1
    Registered User
    Join Date
    Feb 2006
    Posts
    14

    give me some idea..

    how can i solve this problem...
    nid to input a number and will output **** that will form look like the number i input..

    304=** will be look like 304

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    847
    I think what you want is this
    Code:
    #include <stdio.h>
    
    
    int main()
    {
    	int Number;
    	scanf("%d", &Number);
    	printf("%d\n", Number);
    	return 0;
    }

  3. #3
    Registered User
    Join Date
    Feb 2006
    Posts
    14
    but how will it print **** that will form look like the number i input?

  4. #4
    aoeuhtns
    Join Date
    Jul 2005
    Posts
    581
    The phrase, "how will it print **** that will form look like the number i input?" doesn't make any sense, so try rewording.

  5. #5
    Registered User
    Join Date
    Dec 2005
    Location
    Australia - Melbourne
    Posts
    63
    put each digit in an array i.e
    Code:
    int na[3] = {3,0,4};
    then simply use a switch or if statment and print each number's symbol in a loop
    i.e
    Code:
    if(na[i] == 0) printf(" * \n* *\n *\n");  // display zero symbol
    this will however print the number symbols vertically down the screen
    it is much harder to print horizontal

  6. #6
    Sr. Software Engineer filker0's Avatar
    Join Date
    Sep 2005
    Location
    West Virginia
    Posts
    235
    Quote Originally Posted by rothj0hn
    304=** will be look like 304
    Do you mean that if the user inputs 304, your program should display a bunch of spaces and "*" characters that take the form of the digits "3", "0", and "4"?

    There are several ways to do that. I'd suggest starting with some graph paper and work out the "bitmaps" for each digit character. Figure out how to store the pattern for each of those 10 characters in a C program, and how to display those patterns side-by-side.

    If you don't understand arrays in C, you should learn about them before you attempt this programming task.
    Insert obnoxious but pithy remark here

  7. #7
    Registered User
    Join Date
    Feb 2006
    Posts
    14

    ei

    actually im trying to use a gotoxy(x,y)
    bunch of gotoxy until i formed a number figure made of ****...
    but i doubt that my program wont be flexible..
    coz ive only made a number figure made of ***** from 0-9
    single digits only.. problem is if input is 3digits or more.. i cant produce any output..

  8. #8
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    So paste the code that you wrote to draw say zero.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Game Idea (Tetris Maze)
    By SlyMaelstrom in forum Game Programming
    Replies: 13
    Last Post: 06-07-2006, 05:48 PM
  2. An Idea I have...
    By TechWins in forum Tech Board
    Replies: 1
    Last Post: 07-25-2003, 05:49 AM
  3. How To Give A Font Colour ?
    By Unregistered in forum Windows Programming
    Replies: 1
    Last Post: 09-14-2001, 01:22 PM
  4. Just to give you an idea of what we're going through...
    By rick barclay in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 09-13-2001, 02:09 PM
  5. An Idea For The Site: Function Reference Sheets
    By thorym in forum A Brief History of Cprogramming.com
    Replies: 0
    Last Post: 08-16-2001, 07:21 PM