| | |
Fraction to float
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Aug 2009
Posts: 5
Reputation:
Solved Threads: 0
I'm currently working with a group of my classmates on a recipe measurement converter, and I'm currently on the most difficult code of the three that is my part of the project. The code is basically for getting the amount from the user, a fraction. I have based my algorithm as reading the fraction as a string and converting it into an int. I haven't got a decent piece of code together yet, I'm still jotting out my algorithm and just keep getting turned around...please if someone can help with any ideas please do so I might can make a start at this!!! Thanks so much! Kat
•
•
Join Date: Oct 2009
Posts: 70
Reputation:
Solved Threads: 3
0
#2 Nov 2nd, 2009
•
•
•
•
I'm currently working with a group of my classmates on a recipe measurement converter, and I'm currently on the most difficult code of the three that is my part of the project. The code is basically for getting the amount from the user, a fraction. I have based my algorithm as reading the fraction as a string and converting it into an int. I haven't got a decent piece of code together yet, I'm still jotting out my algorithm and just keep getting turned around...please if someone can help with any ideas please do so I might can make a start at this!!! Thanks so much! Kat
without code its highly difficult to get the help here (-
0
#3 Nov 3rd, 2009
You mean the input is something like this ?
And its read as a string.
If so then separate the string into 2 components the left side before the '/' character and the right side, after the '/' character. Then use the
atoifunction .
C Syntax (Toggle Plain Text)
<enter fraction > 123/452
And its read as a string.
If so then separate the string into 2 components the left side before the '/' character and the right side, after the '/' character. Then use the
atoifunction .
1) Prove that the area of a circle is pi*r^2, where "r" is the radius of the circle. 2) Problem 2[b]solved by : jonsca
![]() |
Similar Threads
- Python Help - decimal to binary program (Python)
- practice exercise for car payments help please (C++)
- Java Dummie Needs Loop Help (Java)
- Need some help on my program!!!!!! (C++)
- converting a float to a fraction. (C++)
Other Threads in the C Forum
- Previous Thread: [Help] How to Get Linux Kernel Behavior
- Next Thread: Display in C for multiple threads
Views: 223 | Replies: 2
| Thread Tools | Search this Thread |
Tag cloud for C
adobe ansi api array arrays bash binarysearch centimeter char convert copyanyfile copypdffile cprogramme createcopyoffile createprocess() csyntax directory drawing dynamic executable fflush file fork frequency getlasterror givemetehcodez global graphics gtkgcurlcompiling hardware highest homework i/o inches infiniteloop initialization interest km lazy linked linkedlist linux linuxsegmentationfault list locate logical_drives match matrix meter microsoft motherboard multi mysql open opendocumentformat opensource owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes read recursion recv repetition scanf scheduling segmentationfault send shape socketprograming spoonfeeding stack standard strchr string strings structures student suggestions system systemcall test testautomation unix user visualstudio voidmain() wab win32 win32api windows.h






