Question

Homework - Topic 1 - Print 1 to 100: Write a program that prints the numbers from 1 to 100 with five values per line, two bla
0 0
Add a comment Improve this question Transcribed image text
Answer #1

Java Code:

class Main {

public static void main(String[] args) {

int count=0;

for(int i=1;i<=100;i++){

String str=count%5==0?"\n":"";

System.out.print(str);

System.out.print(i+" ");

count++;

}

}

}

https://WittyThoroughNetworking.kunlstudy.repl.run Open JDK Runtime Environment (build 10.0.2+13-Ubuntu-lubuntu.18 .04.4) ? j

if you like the answer please provide a thumbs up.

Add a comment
Know the answer?
Add Answer to:
Homework - Topic 1 - Print 1 to 100: Write a program that prints the numbers...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Hi, please may I have help with question 10. Thank you! 10. A weather person claims...

    Hi, please may I have help with question 10. Thank you! 10. A weather person claims that the average of the highest temps in the U.S. is 98°. A sample of 50 cities is selected and the highest temps are shown below. At a 0.10, can the claim be rejected? Assume o 7.71 97 96 101 98 99 97 99 91 100 98 94 80 87 95 99 98 108 96 93 80 96 95 88 88 98 99 97...

  • QUESTION 12 Count the possible combinations of 2 numbers chosen from the list (99, 98, 97,...

    QUESTION 12 Count the possible combinations of 2 numbers chosen from the list (99, 98, 97, 96, 95, 94, 93, 92, 91). A. 36 OB.2 C.72 D. 5040

  • I need it in JAVA Write a program that randomly populates an array of size 100,...

    I need it in JAVA Write a program that randomly populates an array of size 100, sorts it, and then finds the median. The random numbers must be from 0-99 and all integer values. Also since there is an even set of numbers the median is found by taking the mean of the two middle numbers (In other words the 50th and 51st). You have to code your own sorting method. You may not use a built in java sorter....

  • Write a python nested for loop that prints out the following pattern 100 99 98 97...

    Write a python nested for loop that prints out the following pattern 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70 69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40 39 38 37 36 35 34 33...

  • Write a C program to assign natural numbers 1 to 100 into a one-dimensional integer array....

    Write a C program to assign natural numbers 1 to 100 into a one-dimensional integer array. Display all the values in the array on the screen. For each number in the array, determine if the number contains digit 7 or is divisible by 7. Display all those numbers on the screen. Original array: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27...

  • 1. On the following page are the exam scores on the first Statistics test for all...

    1. On the following page are the exam scores on the first Statistics test for all my classes. Using everything we covered in the first three chapters of our textbook, describe the data. I recommend going through your notes and textbook, chapter by chapter. Include as much as you can – type of data, frequency distribution, histogram, numerical methods, etc. The standard deviation for the data is 16.7. Exam Scores on the First Statistics Test 100 88 100 86 100...

  • Write a C program that prints the numbers from 1 to 100. But for multiples of...

    Write a C program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

  • Midterm1 = (83.33, 98.33, 75, 91.67, 96.67, 95, 86.67, 65, 100, 100, 80, 88.33, 96.67, 96.67,...

    Midterm1 = (83.33, 98.33, 75, 91.67, 96.67, 95, 86.67, 65, 100, 100, 80, 88.33, 96.67, 96.67, 90, 96.67, 86.67, 93.33, 80, 91.67, 98.33, 86.67, 85, 86.67, 95, 83.33, 96.67, 81.67, 98.33, 100, 95, 93.33, 91.67, 88.33, 98.33, 93.33, 98.33, 93.33, 85, 88.33, 100, 98.33, 96.67, 90, 86.67, 100, 96.67, 98.33, 90, 96.67, 86.67, 95, 78.33, 86.67, 100, 81.67, 96.67, 91.67, 96.67, 96.67, 95, 96.67, 73.33, 100, 93.33, 96.67, 88.33, 70, 96.67, 96.67, 100, 88.33, 96.67, 100, 88.33, 100, 78.33, 93.33,...

  • 2. Assume that the first set of scores below represents the IQ scores of children who...

    2. Assume that the first set of scores below represents the IQ scores of children who have been participating in a school lunch program and the second set of scores represent the IQs of a similar group of children who have not participated in the program. a.         Prepare appropriate graphical representations of the frequency and relative frequency distributions. b.         Compare the two distributions by placing them on the same graph. Be sure to have equivalent intervals, if grouped....

  •  Zoe is interested to learn about the different types of payment app in different countries. She wants to estimate the...

     Zoe is interested to learn about the different types of payment app in different countries. She wants to estimate the number of Middleware apps that successfully passed the overall compliance checks in country D, in 2015. Based on the data available, what answer should she give? Percentage of payment apps achieving compliance for each of the 8 regulations in 2015 Note: To achieve overall compliance, a payment app must comply with all 8 regulations. Regulation Number Overall compliance pass...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT