answersLogoWhite

0

Yes, it is possible to do that.

User Avatar

Wiki User

10y ago

What else can I help you with?

Continue Learning about Math & Arithmetic

Program for generate multiples of 9 upto 500 using PYTHON?

In order to display multiples of 9 up to 500 I would use a while loop with the condition number < 500. For example: #set number to the first multiple of 9 number = 9; while number < 500: print number; #add 9 to the number number += 9; Note: I put semicolons at the end of each line out of habit. Python does not require this. Note: lines beginning with # are comments The above code will print the current value of number, then add 9 to it. It will continue to do this until number is greater than or equal to 500.


How do you write a program to twin print prime numbers from 1 to 50 in PHP?

I suggest you write an outer loop, that loops through all the numbers from 1 to 50. Call the variable that controls the loop something like "number".Then, initially assume the number is a prime (with a variable such as "isprime"); and write another loop that compares whether the number is divisible by any number from 2 to number-1. Call the controlling variable "factor". If number is divisible by factor, then it is not a prime, and you can exit the loop. At the end of the inner loop, if the variable "isprime" is still true, then you print the number.


What is the most common finger print pattern?

The most common fingerprint pattern is the loop, which accounts for about 60-70% of all fingerprints. Loops are characterized by ridge lines that enter from one side, loop around, and exit on the same side. There are two main types of loops: ulnar loops, which flow toward the little finger, and radial loops, which flow toward the thumb. This pattern is widely used in forensic science and biometric identification.


How do you check a prime number in qbasic?

Cls input "enter the no. You want to check", a if a <=0 then print "only natural nos allowed" if a <=0 end let m = a - 1 for i = m to 2 step -1 if a mod i = 0 then print "not prime" if a mod i = 0 then end next i print "prime" end


How do you calculate the prime number?

Given: All Prime numbers are odd, If a number is even it is not prime, If a number is odd and it can be divided by something other than itself or 1 it is not prime. 1.) One way to test an odd number and determine whether it is prime is to start with the number 3 and try dividing it perfectly into the odd number: For example, 27 is odd, but it can be divided by the number 3 which divides perfectly into 27 nine times. 3 x 9 = 27. So 27 is not prime. If 3 doesn't divide perfectly into the number then keep adding 2 to the factor and try dividing the number by the new factor: For example, 91 is odd, but 3 does not perfectly divide 91, so we add 2 to 3 and try dividing 91 by 5 which we know immediately will not work since 91 does not end in 0 or 5, so we add 2 more and try dividing 91 by 7. We find that 7 divides perfectly into 91 thirteen times. 7 x 13 = 91, so 91 is not prime. If you know your times tables it makes this determination easier since we can also eliminate all multiples of each number that doesn't divide perfectly into the test number. For example, since 2 doesn't divide perfectly into a prime number then all multiples of 2 (all even numbers) are not eligible as potentially divisors. If 3 doesn't divide perfectly then all multiples of 3 do not have to be tested (i.e., 9, 15, 21, 27, 33...) Last example using the above tests: Is 97 prime? Given: When I use the word "divided" I mean perfectly divided Is 97 even? No, so all multiples of 2 are eliminated from testing Can 97 be divided by 3? No, so all multiples of 3 are eliminated from testing Can 97 be divided by 5? No, so all multiples of 5 are eliminated from testing Can 97 be divided by 7? No, so all multiples of 7 are eliminated from testing Can 97 be divided by 11? No, so all multiples of 11 are eliminated from testing Can 97 be divided by 13? No, so all multiples of 13 are eliminated from testing Can 97 be divided by 17? No, so all multiples of 17 are eliminated from testing Can 97 be divided by 19? No, so all multiples of 19 are eliminated from testing Can 97 be divided by 23? No, so all multiples of 23 are eliminated from testing Can 97 be divided by 29? No, so all multiples of 29 are eliminated from testing Can 97 be divided by 31? No, so all multiples of 31 are eliminated from testing We can safely say that 97 is prime at this point. Why? Because the next number to test is 37 and since 37 x 3 is 111 and we cannot divide 97 by 3 then no larger number will work. All factors have been effectively tested, albeit the slow way, but it works 100% of the time to determine primeness. Larger numbers may cause this method to be too time consuming; a formula used with a calculator would best be implemented to calculate primeness with larger numbers. You could also print out a prime number table as a reference.

Related Questions

How do you print square using for loops?

how to print "square" using for loop


How do you write a program to print the first n multiples of 7?

Algorithm: multiples input: two positive integers, m and n output: print first n multiples of m i = m; for j = 1 to n print i i = i + m; next j


How many keywords are there in c?

answer:32 programme to print factorial of a given number in c languages


How do you print the multiplication tables in qbasic?

To print multiplication tables in QBasic, you can use nested loops. The outer loop iterates through the numbers 1 to 10 (or any desired range), while the inner loop multiplies the current number by each number in the same range. Here's a simple example: FOR i = 1 TO 10 PRINT "Table of"; i FOR j = 1 TO 10 PRINT i; "*"; j; "="; i * j NEXT j PRINT NEXT i This code will display the multiplication tables for numbers 1 to 10.


Program for generate multiples of 9 upto 500 using PYTHON?

In order to display multiples of 9 up to 500 I would use a while loop with the condition number < 500. For example: #set number to the first multiple of 9 number = 9; while number < 500: print number; #add 9 to the number number += 9; Note: I put semicolons at the end of each line out of habit. Python does not require this. Note: lines beginning with # are comments The above code will print the current value of number, then add 9 to it. It will continue to do this until number is greater than or equal to 500.


By using awk programming how to count number of lines in a given file without wc command?

Use the following:awk 'END { print NR }'Awk will count the lines and print it out.


To print the first 10 multiples of 7. (Table of first 10 terms)?

3


C program to fine the largest of 10 given number?

first sort the ten numbers in descending order and print the first number. That will be the largest no


What is program that will print all the multiples of 4 till 120?

Depending on language, here's an example: for i=4 to 120 step 4 print i next


What is the difference between radial and ulnar loops?

Why are you posting a question to do with finger print identification in several computer programming wikies.


Why is it that an irrational number is never given for a person's weight?

Because you would need an infinite length of paper to print out the ticket.


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.