473,387 Members | 1,497 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Program to break up ints input by user in different ways

1
write a program in C that reads any 5 digit numbers and displays the number in two parts digonally as shown in the user interface screen as in the figure below.
please key in any 5 digit numbers:56789

5678 9
567 89
56 789
5 6789
the number displayed is separated into two parts beginning with the rightmost unit digit.the process continues until the leftmost digit is reached.
Sep 13 '07 #1
5 1508
Savage
1,764 Expert 1GB
write a program in C that reads any 5 digit numbers and displays the number in two parts digonally as shown in the user interface screen as in the figure below.
please key in any 5 digit numbers:56789

5678 9
567 89
56 789
5 6789
the number displayed is separated into two parts beginning with the rightmost unit digit.the process continues until the leftmost digit is reached.
And what have you tried so far?

ps:Please read posting guidelines.

Savage
Sep 13 '07 #2
sicarie
4,677 Expert Mod 4TB
write a program in C that reads any 5 digit numbers and displays the number in two parts digonally as shown in the user interface screen as in the figure below.
please key in any 5 digit numbers:56789

5678 9
567 89
56 789
5 6789
the number displayed is separated into two parts beginning with the rightmost unit digit.the process continues until the leftmost digit is reached.
Okay. My hourly rate three years ago was $150. I think with inflation and my skillset that I'll bring to this program, $200 is fair. This will probably take me about 3 hours, including design and documentation. Do you have PayPal?

An alternative is for you to check out our Posting Guidelines, specifically the part on how to ask a question, and then post again so that everyone here can help you with it. You'd probably also learn more this way (so you can pass your final project easier as well).
Sep 13 '07 #3
mattmao
121 100+
First show what you have done, that would be better...

I suggest you try reading through some novice reference books, particularly in the chapter of iteration where you learn for loop, while loop and do-while loop.

My hint is: a for loop with a printf inside would do for your question.
Sep 14 '07 #4
JosAH
11,448 Expert 8TB
Expand|Select|Wrap|Line Numbers
  1. int o=56789;for(int O=1;!((O*=10)>>14);printf("%d%c%d\n",o/O,0x20,o%O));
  2.  
Ok, now what?

kind regards,

Jos
Sep 14 '07 #5
mattmao
121 100+
Expand|Select|Wrap|Line Numbers
  1. int o=56789;for(int O=1;!((O*=10)>>14);printf("%d%c%d\n",o/O,0x20,o%O));
  2.  
Ok, now what?

kind regards,

Jos
This is an expert's job XDDD.

I will take a note of this for my later use...
Sep 14 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: OZ | last post by:
the serproxy claim itself a multi-thread proxy thing. I have sent email to write the original writer and there is no replay after 3 weeks. my configuration and setting are good. ...
6
by: tigrfire | last post by:
I've been working on a program to try and play a game of Craps, based on a version I found elsewhere - I didn't code the original, but I added a few things such as a balance and wager system. I'm...
8
by: SK | last post by:
Hi I am trying to write a simple C program with devc++ as the complier using the concept of arrays. I cannot get the program to compile without mutiple errors. If anyone has the time to help me...
13
by: vgame64 | last post by:
Hi, I have been struggling with writing a program for a few hours. The requirements are that: """You will be writing a program which will determine whether a date is valid in terms of days in that...
2
by: Simon Wittber | last post by:
I'm building a web application using sqlalchemy in my db layer. Some of the tables require single integer primary keys which might be exposed in some parts of the web interface. If users can...
2
by: Gary Wessle | last post by:
Hi I need help organizing this program in the right way. I included the code below which compiles and runs and gives the desired effect to a certain point, but I don't know what the next step...
43
by: davidkoree | last post by:
I mean not about cookie. Does it have something to do with operating system or browser plugin? I appreciate any help.
3
by: cs | last post by:
Hi, I'm new to C and would appreciate any feedback on the following program, asplit, which splits a file into 2 new files, putting a certain number of lines in the first file, and all the rest...
1
by: jerry | last post by:
i have written a simple phonebook program,i'll show you some of the codes,the program's head file is member.h . i suppose the head file works well.so i don't post it. here's the clips of main...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.