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
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
I think what you want is this
Code:#include <stdio.h> int main() { int Number; scanf("%d", &Number); printf("%d\n", Number); return 0; }
but how will it print **** that will form look like the number i input?
The phrase, "how will it print **** that will form look like the number i input?" doesn't make any sense, so try rewording.
put each digit in an array i.e
then simply use a switch or if statment and print each number's symbol in a loopCode:int na[3] = {3,0,4};
i.ethis will however print the number symbols vertically down the screenCode:if(na[i] == 0) printf(" * \n* *\n *\n"); // display zero symbol
it is much harder to print horizontal
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"?Originally Posted by rothj0hn
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
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..
So paste the code that you wrote to draw say zero.