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
Answer:
input number
calculate modulus of the number and 5
compare outcome to 0
if 0 then output "divisible by 5"
else output "not divisible by 5"
Explanation:
The modulo operator is key here. It returns the remainder after integer division. So 8 mod 5 for example is 3, since 5x1+3 = 8. Only if the outcome is 0, you know the number you divided is a multiple of 5.
Answer:
Explanation:
there are different ways of quick navigation between files and functions. ... You should use the menu 'Remove file from project' instead of deleting files. ... A Makefile generation tool for Code::Blocks IDE by Mirai Computing
Answer:
The correct answer to the following question will be "Firewall".
Explanation:
A firewall seems to be a device that prevents access to the network or from a closed network. You may incorporate a firewall either within the form of network connectivity or under both.
- It blocks unwanted network people from accessing Internet-connected networks, in particular private networks or intranets.
- They are effective in stopping viruses, malware, and worms.
So, it's the right answer.
I want to delete my account as i do
that is what google translate says<span />