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
Visit the target Let Me Discover page and review the history of HTML. Also, search the internet for the history of the internet
Lyrx [107]

Whether you are a novice, hoping to delve into the world of web design or an experienced webmaster keen to improve your skills, we’ve got online tutorials tailored to your web design needs.


Our HTML For Absolute Beginners will turn you from wannabe to webmaster in just a few hours. Unlike many other HTML tutorials, it's a step-by-step guide – not a boring long-winded reference.


Our step-by-step guide teaches you the basics of HTML and how to build your first website. That means how to layout an HTML page, how to add text and images, how to add headings and text formatting, and how to use tables.

use this because that is cheating no offence

3 0
3 years ago
Which of the following Office Online apps is most effective for creating spreadsheets?
navik [9.2K]
The answer is C Excel. Excel allows you to make spreadsheets.

Hope this helps :-)
4 0
3 years ago
Read 2 more answers
HTML5 is______because it works on tablet or smartphone,notebooks
jeyben [28]

Answer:

Wonderful and easy language

Explanation:

Hope this helps

3 0
3 years ago
Read 2 more answers
Briefly summarize what vehicle forensics is.
Alenkinab [10]

Answer:

Vehicle forensics is a process that yields a myriad of data potentially helpful to all kinds of investigations, from law enforcement cases, to insurance fraud, to accident reconstruction. Many newer vehicles (generally 2008 and newer) are equipped with an infotainment system.

4 0
3 years ago
This is more a question for Brainly,
Mashutka [201]

Answer:

some questions may require links, however there should be a process that links have to be verified before they show.

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • The mouse and keyboard are also sometimes called
    5·1 answer
  • What is the definition of D1-D4?
    14·1 answer
  • How long does it take to be placed in a class on flvs?
    14·1 answer
  • What is text box and label control​
    10·2 answers
  • Introduction to computing systems: from bits and gates to c and beyond
    7·1 answer
  • Using ________ as a promotion method will bring return visitors to your site.
    8·1 answer
  • You designed a program to create a username using the first three letters from the first name and the first four letters of the
    6·1 answer
  • Where can I learn how you hack?​
    8·2 answers
  • To provide for unobtrusive validation, you can install the ____________________ package for unobtrusive validation.
    11·1 answer
  • Explain the measures put in place in order to maintain each of the element of computer security<br>​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!