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
Shelly tells a friend that her computer needs to be fixed because it has been producing a lot of heat and is smoking. Where is t
abruzzese [7]

Answer:

Her computer is producing thermal energy, not heat.

Explanation:

Shelly informs her friend that she wants to repair her system because it has generated a lot of heat and therefore is smoking. Her device produces thermal energy but not heat because when she's working continuously and her system's CPU inside any blocked area at that time electricity pass through the CPU and blocked inside then it producing the thermal energy.

4 0
3 years ago
All of the following are valid Excel arithmetic operators except _____.
stellarik [79]
All the following are valid Excel arithmetic operators except D (>). caret(^), asterisk(*), percent(%) and plus/minus (+,-) signs are all arithmetic. Letter D the greater than and less than sign(<, >) is a comparison operators where you compare two values using greater/less than signs.
3 0
3 years ago
1.) what is the minimum number of bits required to represent -3,997 using 2's complement form?
lisabon 2012 [21]

The binary representation of +3997 is 1111 1001 1101.

In one's complement this is simply adding a sign bit and inverting all the bits:

1 0000 0110 0010

The two's complement is the one's complement plus 1:

1 0000 0110 0011

That's 13 bits. Normally the sign bit would be at an 8, 16 or 32,... bit boundary.

For -436 it's 10 0100 1100 and 10 bits


8 0
4 years ago
____ is one of the primary operations of a computer.
Romashka [77]
Processing <span>is one of the primary operations of a computer.</span>
7 0
3 years ago
A user on a home network needs to boost the signal of the wireless router. What should the user purchase to accomplish this?
alexira [117]

Answer:

Repeater

Explanation:

Repeater is the device that is used in networking to enhance or boost the signal to increase the range of the signal.

So the user should purchase the Repeater to boost the wireless signal.

6 0
3 years ago
Other questions:
  • When a cache block has been modified since being read from main memory?
    10·2 answers
  • Fill in the blank. Do not abbreviate.
    6·1 answer
  • What file may contain data written to it in case of an unexpected error or program shut-down?
    5·1 answer
  • Design and implement an algorithm that gets a list of k integar values N1, N2,...Nk as well as a special value SUM. Your algorit
    10·1 answer
  • There are many modes of remote visual communication. which is the most common mode
    5·1 answer
  • Cual es la importancia de aplicar los pasos en el modelo de diseño en las actividades académicas?
    14·1 answer
  • Although your project has been accepted by the customer, the contract with the system vendor specifies that it will support the
    13·1 answer
  • Design 3 classes: Computer - Superclass
    11·1 answer
  • In a List of Positive Integers, Set MINIMUM to 1. For each number X in the list L, compare it to MINIMUM. If X is smaller, set M
    11·1 answer
  • What was one effect of better printing methods during the Ming Dynasty? Updated trade routes A new merchant class Increased lite
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!