77 Topics

Member Avatar for
Member Avatar for Alochai

[CODE]/* Name: Copyright: Author: Date: 14/09/10 21:17 Description: */ #include<iostream> #include<istream> #include<ostream> #include<string> int c_f_fraction(); int c_f_decimal(); int c_f_percent(); int convert_to(); int convert(); int help(); std::string convert_code(""); float c_f_fraction_1(0); float c_f_fraction_2(0); float c_f_result(0); float c_f_decimal_1(0); float c_f_percent_1(0); int help_code(0); int main() { std::cout << "\nWhich would you like to convert, …

Member Avatar for Alochai
0
1K
Member Avatar for Exercitus

Hello, I have a program assignment that is supposed to that converts decimal numbers to binary, hexadecimal, and BCD. I am having an issue with keep the leading zeros on the binary. I have used a recursive function to output a binary conversion. [CODE]#include <iostream> #include <iomanip> using namespace std; …

Member Avatar for daviddoria
0
311
Member Avatar for guru_iyer

I've been trying to display the equivalent decimal number of the input binary number. I tried the below piece of code but am not achieving the result. I don't seem to understand why? Please Help!! [CODE] #include<stdio.h> #include<conio.h> #include<math.h> int a=0; int main() { char bin[8]; int i=0,len=0,r=0,w; printf("Enter a …

Member Avatar for volvo877
0
507
Member Avatar for Rez11

I am trying to write a program that takes a user submitted number of test, along with the test scores. Then I need to sort them in ascending order. (I've done all this). Now I need to get the average, but my getAvg function drops will drop the decimal and …

Member Avatar for dusktreader
0
196
Member Avatar for muralibobby2015

hello.. i have to do substraction of two php variables which is having datatype varchar. i am trying like this.[CODE] $a=5; $b=3; $c=$a-$b; [/CODE] but for float values [CODE] $a=3000.90; $b=2000; $c=$a-$b; [/CODE] out put is $1000.9. ok even i echo $a i am getting 3000.9 how to get two …

Member Avatar for muralibobby2015
0
85
Member Avatar for dansnyderECE

I need to convert an ASCII string like... "hello2" into it's decimal and or hexadecimal representation (a numeric form, the specific kind is irrelevant). So, "hello" would be : 68 65 6c 6c 6f 32 in HEX. How do I do this in C++ without just using a giant if …

Member Avatar for vijayan121
0
218
Member Avatar for PomonaGrange

Hi All, I am trying to program a web based cash register/POS application. I would like to use a function to format the number in the "Amount Received" text box. The idea I have in mind is to always keep two decimal places at all times. For Example: if someone …

Member Avatar for fxm
0
3K
Member Avatar for j23

i want to use input validation so that the user can only input decimal numbers. can someone help [CODE] while int_x != : #this is where im having the problem print "the number entered must be a decimal number" int_x = input("Enter a decimal number:") [/CODE]

Member Avatar for ultimatebuster
0
2K
Member Avatar for Sinaru

I wrote this code for fun. Wanted to do such a thing so that I would be able to use this in the future. I'm kinda new to this forum. I like to know what you think about the code. If can point out some mistakes or ways to improve …

Member Avatar for mrnutty
1
181
Member Avatar for dixie_flatline

Hi, i have a project to do in VB and its been a while i done anything in it. My problem is taxation and decimal places. How can I round 2.19 to 2.20 ? the actuall number was 2.194 and vb6 rounds it at 2.19, is this as it should …

Member Avatar for dixie_flatline
0
2K
Member Avatar for apo

how can a make the floating variable show just 4 digits i mean : 8.6540098 to just 8.654 i guess what i'm trying to say is "less decimals" :D

Member Avatar for jonsca
0
127
Member Avatar for rtllz

Im using xcode to write my program. Every time I build and run the program it will do everything fine, until the end. It keeps giving me an answer of 0 no matter what i put. Need help to figure out what im doing wrong thanks in advance. [CODE]//price_converter #include …

Member Avatar for rtllz
0
142
Member Avatar for naveenreddy61

the code takes each character and stores where and how many times a roman numeral appears and the assess the integer. this is my first code im posting. anything to make the code better is most welcome. roman numeral refers to M=1000 D=500 C=100 L=50 X=10 V=5 I=1 and uses …

Member Avatar for WaltP
0
897
Member Avatar for vegaseat

Convert a decimal (denary) integer to a binary string. An exercise in do ... while and while loops.

Member Avatar for arun26
2
2K
Member Avatar for jagan605

i recently started typing the code for the program to convert a binary number to its decimal form and i got stuck when my compiler reported this error. this is what i have typed till now. [CODE]#include<iostream> using namespace std; #include<math.h> main() { int n,s=0,k=0,a,b,c; cout<<"\n\n\tPROGRAM TO CONVERT BINARY TO …

Member Avatar for jagan605
0
196
Member Avatar for dagohbah

I'm having horrible trouble trying to get this converter to work. If more code is needed, please feel free to let me know. The function I'm having trouble with getting the numbers to convert right is OctalIntoDecimal. The number it is trying to convert is a 9 in decimal...which should …

2
90
Member Avatar for rob-lozyniak

I am aware that JavaScript arithmetic does not handle either really large numbers or decimals well. This is why I have made this library of functions. I am posting it here rather than under "code snippets" because I would like to learn from your comments. Along with the library is …

0
1K

The End.