digits on the screen separately Programming Software Development by naseerhaider …on scree digit = number % 10; cout << "The digits are: " << digit << " , …"; // get the remaining three digits number number = number / 10; // get the next digit digit =… Digits of float Programming Software Development by techie1991 I want to print a float number with it's digits extending to 20000 digits after the decimal i.e. if the number… Re: Digits of float Programming Software Development by nbaztec float stores with 6 digits of precision. I recommend you go for double (15 digits) & try to output it like [CODE] double var=sqrt(static_cast<double>(2)); printf("%Lf2.15", var); [/CODE] Re: Digits of float Programming Software Development by techie1991 I cannot use a imported library in this program. So, is their no other way of getting a solution as I want. I want to calculate sqrt(2) to the maximum level of digits possible... Re: Digits of float Programming Software Development by mrnutty >>I want to calculate sqrt(2) to the maximum level of digits possible... You can't. Its a [URL="http://en.wikipedia.org/wiki/Square_root_of_2"]irrational number[/URL]. Digits of a number with linked lists? Programming Software Development by sleepybug i m trying to do this program to get digits from a number using linked lists..but don't know … adding two arrays with digits bigger than 8bit Programming Software Development by rokz84 …; "This programs adds two positive integers up to 20 digits long." << endl << endl; cout <…--) { augend[k] = temp[j]; } cout << "Enter addend digits"; cin >> temp[0]; i=0; while(temp…; "This programs adds two positive integers up to 20 digits long." << endl << endl; cout <… Conversion to any base, with a fixed number of digits Programming Software Development by William Hemsworth … (from 2 to 36) int fixedDigitCount // The minimum number of digits it must contain );[/CODE] This gives me the following output…:[QUOTE]Binary with no fixed number of digits (1 to 15): 1 10 11 100 101 110 111… 1010 1011 1100 1101 1110 1111 Binary with 4 fixed digits (1 to 15): 0001 0010 0011 0100 0101 0110 0111… Re: Display the individual digits from the scanner input Programming Software Development by Varunkrishna ….toString().isEmpty()){ digitString.append(digit); //System.out.println("Digits are: "+digitString); } //digitString.append(digit); System.…654 The digits are: 6 The digits are: 5 The digits are: 4 The digits are: 6 The digits are: 5 The digits are:… Re: Display the individual digits from the scanner input Programming Software Development by Varunkrishna … the digit: "); try{ number = input.nextInt(); num = number; digits = 0; digits = num % 10; digit = Integer.toString(num); StringBuilder digitString = new…the digit: 12345 The digits are: 1 The digits are: 2 The digits are: 3 The digits are: 4 The digits are: 5 The length… Re: Display the individual digits from the scanner input Programming Software Development by Varunkrishna … the digit: "); try{ number = input.nextInt(); num = number; digits = 0; digits = num % 10; digit = Integer.toString(num); StringBuilder digitString = new…the digit: 12345 The digits are: 1 The digits are: 2 The digits are: 3 The digits are: 4 The digits are: 5 The length… Add digits untill reaching a single digit Programming Software Development by philipshoe … int(raw_input("Enter, ")) import math digits = int(math.log10(num))+1 print digits [/CODE] example 1587898 then it prints 7…figure out and what code i need to add the digits together. I think i am suppose to use a …while loop like this [CODE]while digits >1:[/CODE] and it will continue to add the… getting sub digits from a number Programming Software Development by lewashby … int date = 0; std::cin >> date; int digits = getNrDigits( date ); if ( digits == 8 ) { std::cout << "Number of…= 3; } else { std::cout << "Invalid number of digits" << std::endl; } return 0; } // FUNCTIONS int getNrDigits… Re: Display the individual digits from the scanner input Programming Software Development by Varunkrishna …(digitString.toString().isEmpty()){ digitString.append(digit); System.out.println("Digits are: "+digitString); } } System.out.println("The length… $ java Digit Please enter the digit: 654 Digits are: 654 Digits are: 65 Digits are: 6 The length of the given 654… Re: Display the individual digits from the scanner input Programming Software Development by Varunkrishna …look like the following ... while(num > 0){ digits = num % 10; digit = new int[num]; digit =… num / 10; i++; System.out.print("The Digits are: "+digit+","); } ... This is… the digit: 800 The Digits are: [I@55f96302 ,The Digits are: [I@3d4eac69 ,The Digits are: [I@42a57993 ,… Re: Display the individual digits from the scanner input Programming Software Development by Slavi … just the numbers without the string "The digits are: " and the length. If I…<numbers.length; i++){ System.out.println("The digits are " + numbers[i]); } System.out.println…12345 The digits are 1 The digits are 2 The digits are 3 The digits are 4 The digits are 5 … Re: adding two arrays with digits bigger than 8bit Programming Software Development by rokz84 …"This programs adds two positive integers up to 20 digits"; cout << " long."…lt;< endl; cout << "Enter augend digits: "; cin >> noskipws >> temp[… ; // End Testing cout << "Enter addend digits: "; cin >> noskipws >> temp[… Re: adding two arrays with digits bigger than 8bit Programming Software Development by Lerner you have entered both numbers and reversed the significant digits so the least significant of each has index 0. Now … index = 19, or whatever. If the sum of the two digits with the same index is above 10 then you need… either the augend or the addend have fewer than 20 digits. what if one has 9 and the other 17? It… Adding 2 integers (up to 30-digits each) by reading them into arrays Programming Software Development by hq1 … teacher said I should make sure the total number of digits read in is less than 30 (I thought the numbers… do I do that? Afterwhich, I will add the corresponding digits from both arrays: A[29] to B[29] etc. I…: lab8b.cpp /*Purpose: to read two integers up to 30 digits each, add them together, and display the result*/ #include <… Number of odd, even and zero digits Programming Software Development by babi.meloo …{ odd++; } } System.out.println("The number of odd digits are: " + odd); System.out.println("The number of… even digits are: " + even); System.out.println("The … Re: getting sub digits from a number Programming Software Development by lewashby … number = ArgList[1]; int digits = strlen( ArgList[1] ); std::cout << digits << std::endl; /* if ( digits == 8 ) { std::cout …= 3; } else { std::cout << "Invalid number of digits" << std::endl; }*/ return 0; } // FUNCTIONS int … Display the individual digits from the scanner input Programming Software Development by Varunkrishna …quot; is: "+i); System.out.println("The Digits are: "+digit+" ,"); } catch(Exception exception…might not have been initialized System.out.println("The Digits are: "+digit+" ,"); ^ 1… Re: Adding 2 integers (up to 30-digits each) by reading them into arrays Programming Software Development by jonsca …. You will probably have to have the user input the digits with a space in between, as cin uses space as… A[29] (so count the number of digits and shift everything to right by total digits - digits in number. No, your upper limit… on digits is 29 so you can have a… Converting digits..need help! Programming Software Development by winry … of the parameter to zero,except 2.And number of digits is unknown.. I made this but its's output is…;iostream> using namespace std; int convertNum(int n){ int digits=0; int remainder; for(int i=n;n!=0;n…/=10) digits=digits+1; for(int j=1;j<=digits;j++){ n=n/10; remainder=n… summing two integers up to 30 digits Programming Software Development by biancaW … of being able to read and write only single-integer digits and to add two integers consisting of one decimal digit… a program that can read two integers up to 30 digits each, add these integers together, and display the result. Test… per array element. If the number is less than 30 digits in length, enter enough leading zeros (to the left of… Re: Creating a program to split numbers into there separate digits Programming Software Development by VernonDozier … (num>0) { //counting the digits num=num/10; totalDigits=counter; num++; i…while (counter>0) { //seperate the digits digit[i]=num%10; number=num/10;… Re: getting sub digits from a number Programming Software Development by VernonDozier Use the / and % operators to perel off and isolate digits. For example, if x = 12345678, to isolate the 345, you … is now 345 Refine this process to isolate the desired digits. Re: getting sub digits from a number Programming Software Development by CGSMCMLXXV …` as integer is held as `1172013`, so, the number of digits is 7 and never as 8. If you really want… the month is before October? Your program should accept `7` digits as well. To break your MMDDYYYY integer in three integers… How do I convert an integer into digits and add their sum? Programming Software Development by ShadowOfBlood … and then outputs both the individual digits of the number and the sum of the digits. For example, it should output the… individual digits of 3456 as 3 4 5…;< endl; cout << "The sum of the digits is " << sum << endl; return 0… Re: How do I convert an integer into digits and add their sum? Programming Software Development by Narue …lt;'\n'; } } [/code] The fun part is getting the digits to print out from most significant to least significant, as…10[/ICODE] in the while loop, you can get the digits in reverse. To print in the right order, you …need to store the digits somewhere (the simpler solution, IMO), or extract the digits from most significant to least …