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
What kind of device is a cpu input or output?
Rina8888 [55]
Correct answer: Neither

The CPU<span> is also known as the </span>processor<span> or microprocessor. The </span>CPU<span> is responsible for executing a sequence of stored instructions called a program. This program will take </span>inputs<span> from an </span>input<span> device, process the </span>input<span> in some way and </span>output<span> the results to an </span>output<span> device.</span> It is neither an input nor an output device, but it is usually connected to both kinds of devices.

Output devices like your monitor, speaker, and printer does not process anything fo it to be categorized as a processing device like your CPU and so as input devices like your mouse, microphone, and keyboard.

3 0
3 years ago
Davids family took him to a hospital as he was suffering from a sericous ailment
marta [7]

Answer:

Here are some other sentences which always demonstrate that perhaps the hospital operates with either the help of technology, which is given below.

Explanation:

  • As eventually as he was acknowledged or confessed, the medical records of David would be documented by the medical practitioners.
  • David was therefore positioned through an ICU during which his heart rate had been monitored closely (those same types of machinery were directly linked to the desktops in position to obtain comment of his vital statistics.)
7 0
2 years ago
HAve a good week lads, good luck on work :D
Leno4ka [110]

Answer:

v; its alright.

Explanation: none v;

8 0
3 years ago
Read 2 more answers
8.18 **zyLab: Schedule Generator Write this program using an IDE. Comment and style the code according to the CS 200 Style Guide
Lera25 [3.4K]

Answer:

huh

Explanation:

sfdghjklhgfdsghjkhgfdsfghjk

3 0
2 years ago
The technique of ________ uses three columns that allows the entrepreneur to weigh both the advantages and the disadvantages of
Mekhanik [1.2K]
Force-field analysis
5 0
3 years ago
Other questions:
  • Which is the best description of a hierarchical report?
    13·1 answer
  • If you purchase a software suite for personal use, you can install the software how many times on how many different machines?
    6·1 answer
  • Fill in the blank
    13·2 answers
  • 안녕하세요! 한국어도 여기서 사용 가능한지 궁금합니다.
    6·2 answers
  • Incident damage ____ is the rapid determination of the scope of the breach of the confidentiality, integrity, and availability o
    6·1 answer
  • Please help me
    10·1 answer
  • What is copy and paste?
    13·2 answers
  • List of rules for expert systems​
    6·1 answer
  • Bob has started a company and registered its name with the government as a private corporation. He tries to create a domain name
    12·1 answer
  • Why is computer science hardware needed to solve problems with computers?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!