Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 1,000 results for
digit
- Page 1
Digit Display
Programming
Software Development
15 Years Ago
by ejiroy
…class DigitsDisplay { public static void main(String[] args) { int
digit
; Scanner input = new Scanner (System.in); System.out.print(&…quot;Enter a positive integer: ");
digit
= input.nextInt(); count = 0; while (
digit
!= 0) { count + = 1;
digit
% 10; System.out.println…
Re: Digit Display
Programming
Software Development
15 Years Ago
by BestJewSinceJC
The last part is definitely wrong.
digit
% 10, if
digit
= 245, will be 5. But
digit
never gets modified there, so your program will run forever. What you should be doing is using a combination of % and / .
Re: Digit length with leading zero?
Programming
Software Development
15 Years Ago
by Adak
… account for leading zeroes. How do I validate a nine
digit
number, using only math and no functions, with possible leading… the char array from right to left, and multiply each
digit
with it's column, according to the base 10 numbering… won't know if a 0 might have a leading
digit
further to the left of it, and thus be a…
Digit length with leading zero?
Programming
Software Development
15 Years Ago
by idlackage
The number I'm looking for is valid when it's positive, and nine digits. I used ( (value >= 100000000) && (value <= 999999999) ) first, which worked okay, but did not account for leading zeroes. How do I validate a nine
digit
number, using only math and no functions, with possible leading zeroes?
Re: Digit length with leading zero?
Programming
Software Development
15 Years Ago
by jephthah
… account for leading zeroes. How do I validate a nine
digit
number, using only math and no functions, with possible leading…
Digit Or Currency to Word (Text) conversion
Programming
Software Development
14 Years Ago
by ashishkumar008
Hello, i want to know how to convert
digit
or currency in words. like- when i enter in textbox […
Re: Digit Summation
Programming
Software Development
14 Years Ago
by daviddoria
I would use std::stringstream to put the int into a stirng. Then the logic is much more straight forward to get each
digit
of the string. You can again use stringstream to get each one back to an int before adding them. iamthewee's option also works, but it could be more confusing to read in my opinion. Dave
Re: Digit Summation
Programming
Software Development
14 Years Ago
by Ryan61343
whatabout to keep doing it till you reach one
digit
A function that takes a 4 digit integer and adds 1 to each digit in scheme
Programming
Computer Science
8 Years Ago
by Roger_2
… 481.6 % 10 = 1 (does not equal 0, increment next
digit
) 3rd
digit
481.6 / 10 = 48.16 48.16 % 10 = 8… (does not equal 0, increment next
digit
) 4th
digit
48.16 / 10 = 4.816 4.816 % 10 = 4…10)) (define (di4 n) (+ n 1) ; increment 1st
digit
(cond ;check if 1st
digit
became 0 if so skip and increment 100…
Re: A function that takes a 4 digit integer and adds 1 to each digit in scheme
Programming
Computer Science
8 Years Ago
by David W
… strings ... and then to code a function to increment each '
digit
' in this string as proscribed ... with a carry term to… the 'next left'
digit
for the case of the incremented '
digit
value' becoming 10. I could show you…
Re: function to return a zero as the most significant digit
Programming
Software Development
15 Years Ago
by tquiva
…quot;%d", &integer) != EOF) { /* Call function to print
digit
*/ put_result(integer); /* Print a blank line */ printf("\n"…(); while (IS_DIGIT(ch)) { /* repeat as long as ch is a
digit
*/ n = n * 10 + dig_to_int(ch); /* accumulate value in n */…
Re: A function that takes a 4 digit integer and adds 1 to each digit in scheme
Programming
Computer Science
8 Years Ago
by David W
…(): while True: try: i = int(input( "Enter a 4
digit
int between 1000 and 9999: " )) if 1000 <= i…
Re: A function that takes a 4 digit integer and adds 1 to each digit in scheme
Programming
Computer Science
8 Years Ago
by David W
… takeInValid4Dig() { while( true ) { string iStr = takeInLine( "Enter a 4
digit
int between 1000 and 9999: " ); if( isValidPosInt(iStr) ) { int…
Re: A function that takes a 4 digit integer and adds 1 to each digit in scheme
Programming
Computer Science
8 Years Ago
by Taywin
…, you will need to call another function which take one
digit
which is taken off from the input number, increase it…
Warning: pack() [function.pack]: Type H: illegal hex digit s in
Programming
Web Development
9 Years Ago
by abhi10kumar
…: Warning: pack() [function.pack]: Type H: illegal hex
digit
s in D:\xampp\htdocs\project\includes\encryption.php on…Warning: pack() [function.pack]: Type H: illegal hex
digit
s in D:\xampp\htdocs\project\includes\encryption.php on…: pack() [function.pack]: Type H: illegal hex
digit
s in D:\xampp\htdocs\project\includes\encryption.php on…
function to return a zero as the most significant digit
Programming
Software Development
15 Years Ago
by tquiva
…integer) != EOF) { /* Call function to print
digit
*/ put_result(integer); /* Print a blank line */ …. It returns an integer with the most significant
digit
removed. */ { return n % wt; }…weight (a power of 10) of the most significant
digit
. */ { int wt = 1; while((n/wt…
5 digit palindrome program
Programming
Software Development
16 Years Ago
by SQ89
… int digit1; // first
digit
int digit2; // second
digit
int digit4; // fourth
digit
int digit5; // fifth
digit
int digits; // number…b, c; System.out.println("Enter a five
digit
number"); // prompt number = input.nextInt(); int…
Hong Kong Identity Card Check Digit
Programming
Software Development
11 Years Ago
by Jumper_1
…/smartcard_front.jpg) Below are the steps for generating the check
digit
. 1. The first letter of the card number is converted… dividing this sum by 11 is computed. 4. The check
digit
is computed by subtracting the remainder from 11. If the… by 11 – 2 = 9. Hence, the card number (with check
digit
) C668668(E) in the sample HKID card is invalid! The…
8 digit or 9 digit
Programming
Software Development
14 Years Ago
by swathys
…a text box to accept 9 or 10
digit
(after check
digit
)and then show the 2nd text box …help me.... [COLOR="red"]code with Check
digit
[/COLOR] [CODE] countvar = 0 If Not FocusedTB Is….PrepareNextButton()[/CODE] [COLOR="red"]code without Check
digit
[/COLOR] [CODE] countvar = 0 If Not FocusedTB Is…
3 digit integer to printable 3 digit string?
Programming
Software Development
10 Years Ago
by Roger_2
…algorithm to accomodate for up to three
digit
integers as the score will need … .bss userScore: resd 4 pcScore: resb 4 number: resd 4
digit
: resd 4 count: resd 4 . . . . . . . . . .… again jne write_number loop2: pop dword[
digit
] ;pop the
digit
from the stack and call write_digit ;…
logic error in big digit class!
Programming
Software Development
15 Years Ago
by complexcodes
…(); i++) { if(!isdigit(str[i]) { cout<<"non-
digit
number is entered, so 1 is used as default value…; return output; } int operator+::LargeDigit(const VeryLongInt &
digit
) { return
digit
.intz+=
digit
.intz; }[/code] I know I am in right direction but…
Re: Warning: pack() [function.pack]: Type H: illegal hex digit s in
Programming
Web Development
9 Years Ago
by diafol
Sounds like you're passing non-hex
digit
's' in the `$key`. Hex = 0->f WHat does $key contain?
Re: logic error in big digit class!
Programming
Software Development
15 Years Ago
by dkalita
[QUOTE=complexcodes;1006836] [code] int operator+::LargeDigit(const VeryLongInt &
digit
) { return
digit
.intz+=
digit
.intz; }[/code] [/QUOTE] it should be [CODE] int LargeDigit…::operator +(const LargeDigit &
digit
)//SEE THE SYNTAX properly { /*your code*/ }[/CODE] where did u…
Re: function to return a zero as the most significant digit
Programming
Software Development
15 Years Ago
by tquiva
… put_result. The function then returns the integer as a character/
digit
. My problem is that it is not returning any 0…
Re: function to return a zero as the most significant digit
Programming
Software Development
15 Years Ago
by tquiva
…; (c) < 127) #define LOWER 0 #define UPPER 1 #define
DIGIT
2 #define PUNCT 3 #define SPACE 4 #define CONTROL 5…
Help Generating All 3 Digit Numbers
Programming
Software Development
13 Years Ago
by cecsFTL
For this project I need to generate all three
digit
numbers where the 1st
digit
is always larger than the 2nd, and the… 2nd
digit
is always larger than the third. I'm not asking …-999 numbers but where the 1st
digit
is always larger than the 2nd and 2nd
digit
is always larger than the third…
Treating integer as a 4 digit number
Programming
Software Development
10 Years Ago
by humorousone
…given range, how many 4
digit
numbers are there, where the 'thousands'
digit
is equal to the sum …int UpperBoundInput = 1234; //Input 4
digit
upper bound here. string LowerBoundInput = 0000; //Input 4
digit
bound here. int TrueCount = 0…orikPX). The problem here is that having 4
digit
numbers leads to all sorts of problems with …
Re: Help Generating All 3 Digit Numbers
Programming
Software Development
13 Years Ago
by cecsFTL
…,986,...999) check if the hundreds
digit
is greater than the tens
digit
and that the tens
digit
is greater than the ones…
digit
. For example, print out 210, ..,321,...432…
Re: Algorithm to generate 10-digit numbers
Programming
Software Development
13 Years Ago
by VernonDozier
… an algorithm that generates all 10-
digit
integers that have at least one
digit
repeated? Trawling through all 9000000000 of…and checking them individually is too slow. Thanks.[/QUOTE] 10
digit
number, 10 digits, none repeated, sounds like you can… ones that start with 0. The set of ten
digit
numbers MINUS this set is your answer. The set …
Re: logic error in big digit class!
Programming
Software Development
15 Years Ago
by dkalita
[QUOTE=complexcodes;1007348]I fix that but I need help in writing the body of that +operator overloading function. Thanks,[/QUOTE] [CODE] int LargeDigit::operator +(const LargeDigit &
digit
) { return (this->intz +
digit
.intz); } [/CODE]
1
2
3
17
Next
Last
Search
Search
Forums
Forum Index
Hardware/Software
Recommended Topics
Programming
Recommended Topics
Digital Media
Recommended Topics
Community Center
Recommended Topics
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2025 DaniWeb® LLC