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]
4 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]4 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
You are an inexperienced excel user and don���t know how to create your own formulas. you want to use one of the preconfigured f
Alexxandr [17]
A. click the insert formula icon on the formulas tab ribbon.
5 0
4 years ago
Which option will you use to expose your presentation to the audience?
Liula [17]
<span>Which option will you use to expose your presentation to the audience?
</span><span>B)Slide Show</span>
6 0
4 years ago
Read 2 more answers
George has to develop a website for his dad’s cycle shop. He wants to focus mainly on the products and wants the website to have
irakobra [83]

Answer:

The correct answer is letter "D": George should only add images that will highlight the products.

Explanation:

Grid formats are web pages designs that instead of portraying information display pictures arranged three by three (3x3) or four by three (4x3) grids so the web page user can select one of the images that is of interest and after clicking on it details of that subject will be on the screen.

In that case, as George is using a grid format for his father's shop website, he should only add images that after been clicked will bring u the content of the corresponding product.

3 0
3 years ago
When superiors providedirections to their subordinates regarding what to do, thisis
cluponka [151]

Answer:

Downward

Explanation:

<u>Downward communication</u>

When instructions/orders given from Superiors to Subordinates.The instruction can be via mail,oral or handbooks it can be of any form. Examples are shareholders instructing management,teacher ordering students to bring notebooks etc.  

<u>Upward communication</u>

When Information is sent bottom level to the upper levels in an organization.The information includes reports,judgments, estimations, propositions, complaints, appeals, etc  

<u>Lateral communication/Horizontal communication</u>

When same hierarchical levels shares idea or information with each other for coordinating, fulfilling a common purpose or goal.It doesn't involve sharing information with up or down levels in organization.

<u></u>

<u></u>

5 0
3 years ago
which quotation from the story of the fisherman in the Arabian nights' entertainments supports the theme that cleverness trumps
Greeley [361]

Answer:

Vexed with having such a bad haul, when he had mended his nets, which the carcass of the butt had broken in several places, he threw them a second time

Explanation:

SORRY IF WRONG JUST TRYING TO GET BRAINLIEST TO LEVEL UP

6 0
4 years ago
Other questions:
  • What would make this comparison statement False? Complete with the appropriate relational operator. "G" _____= "G"
    10·1 answer
  • Which of the following statements are true with regards to satellite internet access
    15·2 answers
  • I need the alphabet quickly! sorry bad with remembering!
    10·1 answer
  • What is the output of the code snippet given below? string s = "aeiou"; int i = 0; do { system.out.print(s.substring(i, i + 1));
    12·1 answer
  • Which of the following is a disadvantage of using open source software?
    14·1 answer
  • Select the correct answer.
    9·2 answers
  • the id selector uses the id attribute of an html element to select a specific element give Example ?​
    11·1 answer
  • A pre-design document you can use to create a new project quickly
    5·1 answer
  • Olivia wants to change some settings in Outlook. What are the steps she will use to get to that function? open Outlook → File →
    7·2 answers
  • What year does futurist ray kurzweil believe ai will meet human intelligence?.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!