CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10

Thread: Problem in C

Threaded View

  1. #1
    Join Date
    Sep 2002
    Location
    India (Delhi)
    Posts
    199

    Thumbs down Problem in C

    i need to create a program in 'C' which simulates LED displays (e.g., a digital clock or microwave). that can print the digits 0 through 9 as block digits (like you would find on an LED display). Each digit should contain only the x and . characters (see example output below), and should be followed by a blank line so the digits are separated. The input to this program will be a number followed by a height and a width. For example, with the input 25, 7, 5, the program will write the digits 2 and 5 (separated by a blank line) where each digit has a height of 7 and a width of 5 characters. Your program requires that the height be an odd number >= 5 and that the width be >= 3. Your program should check that the input line contains three numbers (value, height, and width) and that the height and width adhere to the constraints (height is odd and >= 5, width >= 3). It should inform the user of any input problems.
    Input Line: 256 5 5
    Output:
    Number - 256, Height - 5, Width - 5



    xxxxx
    ......x
    xxxxx
    x......
    xxxxx

    xxxxx
    x.....
    xxxxx
    ......x
    xxxxx

    xxxxx
    x......
    xxxxx
    x....x
    xxxxx



    I can draw the complete box with the given height and width but problem is how to skip printing 'x' to draw char.


    hope i made u understand my problem
    Last edited by kohlimannu; February 20th, 2006 at 05:39 AM.
    Keep Posting in this Forum

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured