1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Kazeer [188]
3 years ago
5

Int main() { printf("%d\n", getOddPositionedDigits(89201)); printf("%d\n", getOddPositionedDigits(-123)); printf("%d\n", getOddP

ositionedDigits(20)); printf("%d\n", getOddPositionedDigits(87654321)); return 0; } Is this code contain any redundancies?
Computers and Technology
1 answer:
Luba_88 [7]3 years ago
3 0

Int Main () dvaunoax o]inxoo jnjn os'i

Explanation: Int Main KIcqvd[uo v[ionon

hxbc ;zzzzzzzzzzzczjHiuhqvzbp;'k

You might be interested in
6.25 (Prime Numbers) A positive integer is prime if it’s divisible by only 1 and itself. For example, 2, 3, 5 and 7 are prime, b
faltersainse [42]

Answer:

  1. public class Main {
  2.    public static void main (String [] args) {
  3.        for(int i = 2; i < 10000; i++){
  4.            if(isPrime1(i)){
  5.               System.out.print(i + " ");
  6.            }
  7.        }
  8.        System.out.println();
  9.        for(int i = 2; i < 10000; i++){
  10.            if(isPrime2(i)){
  11.                System.out.print(i + " ");
  12.            }
  13.        }
  14.    }
  15.    public static boolean isPrime1(int n){
  16.      
  17.        for(int i=2; i <= n/2; i++){
  18.            if(n % i  == 0){
  19.                return false;
  20.            }
  21.        }
  22.        return true;
  23.    }
  24.    public static boolean isPrime2(int n){
  25.        for(int i=2; i <= Math.sqrt(n); i++){
  26.            if(n % i  == 0){
  27.                return false;
  28.            }
  29.        }
  30.        return true;
  31.    }
  32. }

<u></u>

Explanation:

Firstly, create the first version of method to identify a prime number, isPrime1. This version set the limit of the for loop as n/2. The for loop will iterate through the number from 2 till input n / 2 and check if n is divisible by current value of i. If so, return false to show this is not a prime number (Line 22 - 26). Otherwise it return true to indicate this is a prime number.

In the main program, we call the isPrime1 method by passing the i-index value as an argument within a for-loop that will iterate through the number 2 - 10000 (exclusive).  If the method return true, print the current i value). (Line 5 - 9)

The most direct way to ensure all the prime numbers below 10000 are found, is to check the prime status from number 2 - 9999 which is amount to 9998 of numbers.

Next we create a second version of method to check prime, isPrime2 (Line 31 - 40). This version differs from the first version by only changing the for loop condition to i <= square root of n (Line 33).  In the main program, we create another for loop and  repeatedly call the second version of method (Line 13 - 17). We also get the same output as in the previous version.

8 0
3 years ago
What is required to become a good critical thinker? Use a process when dealing with a big issue. Practice the right skills over
Damm [24]

Answer:

Evaluate issues based on logic and reason

Explanation:

Critical Thinking is the ability to think scientifically & logically, analysing based on both formers - rather than rule of thumb.

Critical thinker engages clearly in conceptual, rational thinking. So, an important desirable characteristic of a critical thinker is 'evaluating issues based on logic and reason'.

6 0
3 years ago
1. Power tools are tools that use:
34kurt
Power tools use electricity to run. They need some type of battery or cord to do their job.
6 0
3 years ago
Read 2 more answers
2. Can you see any pitfalls or disadvantages to using Feedly to organize your online content sources?
Sergio039 [100]

Answer:

I think the disadvantages of using feedly is that people might now like switching over to use that or might not understand it.

8 0
3 years ago
AYUDAAAA!!!!! URGENTE!!!!!!1<br> ¿para que sirve la "BIG DATA"?
Lisa [10]

Answer:

Big data is a field that treats ways to analyze, systematically extract information from, or otherwise deal with data sets that are too large or complex to be dealt with by traditional data-processing application software. ... Big data was originally associated with three key concepts: volume, variety, and velocity.

SPANISH TRANSLATION

Big data es un campo que trata formas de analizar, extraer sistemáticamente información de, o de otra manera tratar con conjuntos de datos que son demasiado grandes o complejos para ser manejados por el software tradicional de aplicación de procesamiento de datos. ... Big data se asoció originalmente con tres conceptos clave: volumen, variedad y velocidad.

7 0
3 years ago
Other questions:
  • what is the opportunity cost of buying a $.75 soda everyday at school for 3 years instead of drinking water ? assume you are in
    10·2 answers
  • What is the information age?
    12·1 answer
  • Which column and row references are updated when you copy the formula: =F$5+12?
    14·1 answer
  • Mika forgot to put in the function name in his function header for the code below. What would be the best function header?
    12·2 answers
  • Pleaseeeee helppp
    5·1 answer
  • Can someone plzzzzzzz help
    14·2 answers
  • Unscramble the risks of sharing files on the Intern
    15·1 answer
  • Education leads to higher wages lower unemployment.* True or false
    5·1 answer
  • 11. SQL Output III
    13·1 answer
  • Which practice enables recovery of accidental deletions in data records?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!