answersLogoWhite

0

What else can I help you with?

Continue Learning about Engineering

Write a program in java to enter 3 digits or more arrange the digits of the entered number in ascending order and display the result?

public static void main(String[] args) { int val = 100; int val1 = 50; System.out.println("Number of digits in " + val + " is: " + new String(val + "").length()); System.out.println("Number of digits in " + val1 + " is: " + new String(val1 + "").length()); }


How do you write a program in qbasic to input 64751315 to sum?

In QBASIC, you can write a simple program to input the number 64751315 and sum its digits as follows: DIM sum AS INTEGER sum = 0 INPUT "Enter a number: "; number FOR i = 1 TO LEN(number) sum = sum + VAL(MID$(number, i, 1)) NEXT PRINT "The sum of the digits is "; sum This program prompts the user to input a number, iterates through each digit, converts it to an integer, and adds it to the total sum, which is then printed out.


How to write A Java program to print number of digits in a given number?

One way to do this is to convert the number to a String, then use the corresponding String method to find out the length of the String.


Write a program in shell script to display odd number from 0 to 100?

seq 1 2 99


write a program that will display one if you enter any number without it will display zero in c?

You can use the following C program to display "1" if a user enters any non-zero number, and "0" if the entered number is zero: #include <stdio.h> int main() { int num; printf("Enter a number: "); scanf("%d", &num); if (num != 0) { printf("1\n"); } else { printf("0\n"); } return 0; } This program reads an integer from the user and checks if it is non-zero or zero, then prints the corresponding output.

Related Questions

Write a program in java to enter 3 digits or more arrange the digits of the entered number in ascending order and display the result?

public static void main(String[] args) { int val = 100; int val1 = 50; System.out.println("Number of digits in " + val + " is: " + new String(val + "").length()); System.out.println("Number of digits in " + val1 + " is: " + new String(val1 + "").length()); }


What can a decrease decimal tool do in excel?

It reduces the number of digits after the decimal point in the display, rounding the number as appropriate.


Write a program which takes any number of days from the user the program should display the number of years number of months formed by these days as well as the remaining days?

Write a program which takes any number of days from the user. the program should display the number of years, number of months formed by these days as well as the remaining days.


What is the largest prime number in digits?

As of January 25, 2014, the largest known prime number was calculated to be 257,885,161 − 1; a number containing 17,425,170 digits. This is, of course, too large to display.


Does a calculator display the exact values of all irrational numbers?

No. An irrational number is one that does not repeat or finish, and a calculator cannot display millions of digits like an irrational number would have.


How many times a day does a digital clock display digits whose sum total equals the number of led's used to display them?

A 24 hour clock displays digits whose sum total equals the number of led's used to display them 94 times a day. A 12 hour clock displays them 108 times a day.


Write a Shell program to find the sum of cube of individual digits of a number?

no thanks


Write a program to display the name of days when a user enters a number?

write a program to display your name age class schoolname e-mail 2hobby based on choice


Why is it sometimes when you add 2 numbers in scientific notation in your calculator the result is just greater of the two numbers?

This happens because the contribution of the smaller number is lost in the trailing decimal digits. Suppose you had a calculator that could display 10 digits. Suppose you tried to add 123,456.789 and 0.000 000 12 The true answer is 123,456.789 000 12 but, since you can only display 10 digits, the answer shows as 123,456.7890 which is the larger number. The exact details will depend on the number of displayed digits.


How do you make a program that counts how many times each digit occured in the integer?

To count the number of times a digit occurs in an integer, start by initializing an array of ten counts of digits, such as int digits[10];Then, in a loop while the number is non zero, increment the element in the digits array that corresponds to the units digit, and then divide the number by ten, such as digits[number%10]++ and number/=10;int digits[10];int i;int number = some number;for (i=0; i


What is the largest number you can actually calculate?

There is no upper limit to numbers, there are some astronomical numbers with more digits than the universe has atoms (See Graham's number) used in math. On many calculators, the largest number it can calculate is limited by the number of digits your calculator can display. If it can display 12 digits, the largest number you can calculate on it is 999,999,999,999. The scientific calculators which support scientific notation can usually calculate numbers up to 9.999999 x 1099. Some high-tech ones can go up to 9.99999 x 10999. On the other hand, I use a professional program used to crunch numbers and the largest number it says it can express is 1.920224672692357 x 10646456887 (or 22147483296). Not that I think I would need to use such a large number any time soon.


Write a program to find Armstrong number in visual basic 10?

An Armstrong number (or narcissistic number) for a given number of digits is a number that is equal to the sum of its own digits raised to the power of the number of digits. Here’s a simple Visual Basic 10 program that checks for Armstrong numbers: Module ArmstrongNumber Sub Main() Dim num As Integer Dim sum As Integer = 0 Console.Write("Enter a number: ") num = Convert.ToInt32(Console.ReadLine()) Dim temp As Integer = num Dim digits As Integer = num.ToString().Length While temp > 0 Dim digit As Integer = temp Mod 10 sum += Math.Pow(digit, digits) temp \= 10 End While If sum = num Then Console.WriteLine(num & " is an Armstrong number.") Else Console.WriteLine(num & " is not an Armstrong number.") End If End Sub End Module This program takes a number as input, calculates the sum of its digits raised to the power of the number of digits, and checks if the sum equals the original number.