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
Which of these is a major mobile game developer?
Firlakuza [10]
Im thinking Zynga because it has tons of games
7 0
3 years ago
Read 2 more answers
Do the police check your mobile device during police checks?
Marat540 [252]
it depends............

4 0
3 years ago
Read 2 more answers
What enforces the location in which an app can function by tracking the location of the mobile device?
Igoryamba

The correct answer is geo fencing.

<h3>what is geo fencing?</h3>

A geofence is a fictitious geographic boundary that can be entered or exited by a mobile device or RFID tag. Geofencing is a location-based service in which an app or other software programme uses radio frequency identification (RFID), Wi-Fi, GPS, or cellular data to trigger a targeted marketing action (such as a text, email, social media advertisement, or app notification).

There are three ways to use this technology to target customers: geotargeting, geofencing, and beaconing. You can track a consumer's location using GPS, Bluetooth, and beacons.

learn more about geo fencing refer:

brainly.com/question/20317002

#SPJ4

4 0
2 years ago
Which network type uses a coaxial cable to receive its signal?.
olchik [2.2K]

Answer:

fiber optic

Explanation:

thanks youuuui

6 0
3 years ago
so you just gonna bring me a birthday gift on my birthday to my birthday party on my birthday with a birthday gift
Marina86 [1]

Answer:

Happy birthday.?

Explanation:

*GLASS BREAKS*

5 0
3 years ago
Read 2 more answers
Other questions:
  • How useful do you find the creation of folders in your computer?
    8·2 answers
  • Complete the sentence about a focusing technique.
    7·1 answer
  • Why is it important to ask an interviewer at least one question at the end of an interview?
    12·2 answers
  • An installed theme can be applied by clicking on a theme in the themes group on the ____ tab.
    7·2 answers
  • The term Electronic Privacy Information Center (EPIC) refers to a form of the digital subscriber line technology, which enables
    6·1 answer
  • :If a process terminates, will its threads also terminate or will they continue to run? Explain your answer.
    14·1 answer
  • Which are factors that go into a project plan?
    8·1 answer
  • Write a full class definition for a class named Counter, and containing the following members:________
    9·1 answer
  • Users who are connecting to an NLB cluster have been complaining that after using the site for a few minutes they are prompted t
    15·1 answer
  • You will include code that will validate all user input. If the user inputs an invalid value, the program will respond with an e
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!