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
padilas [110]
3 years ago
6

Write a "for loop" that displays a string in the reverse order (DO NOT use the reverse method) 3.

Computers and Technology
1 answer:
elena55 [62]3 years ago
5 0

Following are the code in java to reverse any string without using reverse function.

import java.util.*; // import package

class Main // class

{

public static void main(String args[])  // main class in java

{

String s, r = "";  // string variable

Scanner out = new Scanner(System.in);  // scanner classes to take input

System.out.println("Enter a string to reverse");

s = out.nextLine();  // input string

int l1 = s.length();  // finding length of string

l1=l1-1;

for ( int i = l1 ; i >= 0 ; i-- )  // for loop to reverse any string

{

r = r + s.charAt(i);

}

System.out.println(" The Reverse String is: "+r);  // print reverse string

  }

}

Explanation:

firstly we input any string ,finding the length of that string then after that iterating over the loop by using for loop and last display that reverse string

output

Enter a string to reverse

san ran

The Reverse String is: nar nas

You might be interested in
Which tectonic plate setting is associated with the following features: great earthquakes; explosive volcanic eruptions; oceanic
yarga [219]

Answer:

Convergent Plate Boundary (subduction zone)

Explanation:

A convergent plate boundary is a location where two tectonic plates are moving toward each other, often causing one plate to slide below the other (in a process known as subduction). The collision of tectonic plates can result in earthquakes, volcanoes, the formation of mountains, and other geological events. An example is the one the formed Andes Mountain.

Cheers

8 0
3 years ago
Plz Help!! How should I answer the second question?
Harman [31]

Answer:

Just keep doing what you were doing explain what you would be doing in the future or where you see yourself in like 5 years and put details and things that make since to you!

4 0
3 years ago
Create a parameter query where the user will enter a value to use as the criterion
Pepsi [2]
Click in the Criteria row in the InsuranceType column and type [Enter Insurance Type]. Click the Run button. Type dental when prompted. Click OK.
6 0
2 years ago
What are the two features of EDIAC ?​
Sergio [31]

Answer:

By the numbers: “The ENIAC contained 17,468 vacuum tubes, along with 70,000 resistors, 10,000 capacitors, 1,500 relays, 6,000 manual switches and 5 million soldered joints. It covered 1,800 square feet (167 square meters) of floor space, weighed 30 tons, consumed 160 kilowatts of electrical power.” More info

3 0
2 years ago
Read the data file to a data frame ss16wa, and only retain columns "PWGTP", "AGEP", "WAGP", "VALP", "WKHP", "CIT", "ACCESS". (2)
Murrr4er [49]

Answer:

Data Frame

A data frame is used for storing data tables. It is a list of vectors of equal length. For example, the following variable df is a data frame containing three vectors n, s, b.

> n = c(2, 3, 5)

> s = c("aa", "bb", "cc")

> b = c(TRUE, FALSE, TRUE)

> df = data.frame(n, s, b)       # df is a data frame

Built-in Data Frame

We use built-in data frames in R for our tutorials. For example, here is a built-in data frame in R, called mtcars.

> mtcars

              mpg cyl disp  hp drat   wt ...

Mazda RX4     21.0   6  160 110 3.90 2.62 ...

Mazda RX4 Wag 21.0   6  160 110 3.90 2.88 ...

Datsun 710    22.8   4  108  93 3.85 2.32 ...

              ............

The top line of the table, called the header, contains the column names. Each horizontal line afterward denotes a data row, which begins with the name of the row, and then followed by the actual data. Each data member of a row is called a cell.

To retrieve data in a cell, we would enter its row and column coordinates in the single square bracket "[]" operator. The two coordinates are separated by a comma. In other words, the coordinates begins with row position, then followed by a comma, and ends with the column position. The order is important.

Explanation:

4 0
3 years ago
Other questions:
  • Which social networking function came first?
    9·2 answers
  • Which is the hanging indent on the ruler?
    10·2 answers
  • __________ is a program that lets you share documents online with others.
    12·2 answers
  • Green field country is planning to conduct a cricket match between two teams A and B. a large crowd is expected in the stadium a
    6·1 answer
  • This assignment is to code a simple hangman game. The game should choose a random word out of a list of words that are coded int
    8·1 answer
  • 2. Read the following scenarios about how three different programmera approach
    7·2 answers
  • What is a field on a table
    13·1 answer
  • Sdq1fdszgdSHTGafeges'
    15·1 answer
  • What two Python data structures are already thread-safe, because they provide automatic support for synchronizing multiple reade
    9·1 answer
  • PLEASE PLEASE HELP. IF THERE A MULTUPLE ANSWERS I WILL BRAINLIEST TO THE BEST ONE!!!!
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!