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
All of the following are functions of the DBMS except ________. Group of answer choices modifying the database getting the users
andreev551 [17]

Answer:

None of the above.

Explanation:

The outlined options are all functions of DBMS.

3 0
3 years ago
A computer screen that is contained in its own case and is not part of the computer system is called a
andre [41]

Answer:

Monitor is the correct answer

7 0
3 years ago
Read 2 more answers
WILL GIVE BRAINLIEST!! NO LINKS!!!
anyanavicka [17]

Answer:

Maybe try a different charger, and if that works, your phone may have an issue..

Explanation:

Sometimes cords just.. don't work right if you use 'em long enough.

7 0
3 years ago
Read 2 more answers
Dan wants to use some of his friend's printed photos of sea creatures for a school multimedia project. Which input device is bes
lora16 [44]

Answer:

OC graphics tablet

Explanation: A oc graphics tablet are very expensive and are mainly used in high tech computers for better graphics.

5 0
3 years ago
Assume that you have 22 slices of pizza and 7 friends that are going to share it (you've already eaten). There's been some argum
xz_007 [3.2K]

Answer:

In Python:

numberOfWholeSlices = int(22/7)

print(numberOfWholeSlices )

Explanation:

For each friend to get a whole number of slices, we need to make use of the int function to get the integer result when the number of slices is divided by the number of people.

So, the number of slice is: 22/7

In python, the expression when assigned to numberOfWholeSlices  is:

numberOfWholeSlices = int(22/7)

Next, is to print the calculated number of slices

print(numberOfWholeSlices )

4 0
3 years ago
Other questions:
  • Information Can Be Gathered Regarding The Temperature Of A Substance And Uploaded To A Computer Using A ___________ As A Data Co
    6·1 answer
  • Develop an sec (single error correction) code for a 16-bit data word. generate the code for the data word 0101000000111001. show
    6·2 answers
  • Kylie has created some code designed to keep track of information about employees at a company. The code will be used by the com
    6·1 answer
  • Which company has experienced censorship in China?
    13·2 answers
  • Select the guidelines you should follow when creating a resume
    12·2 answers
  • Agile methods typically use a ______ model, which represents a series of iterations, or revisions, which are based on user feedb
    7·1 answer
  • Consider the problem of making change for n cents using the fewest number of coins. Assume that each coins value is an integer.
    7·1 answer
  • The rules on the Internet for how messages are addressed and passed on are called ____ .
    15·1 answer
  • so i am on a Chromebook with headphones , and I am wondering if you can make it that a tab only play sound on one side of the he
    12·1 answer
  • Write a function named days() that determines the number of days since January 1, 1900 for any data passed as a structure. Use t
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!