Page 95 - TP_iPlus_V2.1_Class8
P. 95
reverse = reverse + num%10;
num = num/10;
}
System.out.println(reverse);
}
D. Find the error in the following Java codes:
1. public static void main(String args[])
{
System.out.println("Table of 8");
int a = 8, res;
int i;
for (i = 1, i <= 10, i++) {
res = a * i;
System.out.println(res);
}
}
2. public static void main(String args[])
{
int i;
for (i = 1; i <= 5; i++) {
System.out.println("The value of i is: " i);
}
}
3. public class modulus {
public static void main(String args[])
{
int x = 20, y = 45;
int mod = y % x;
System.out.println("Modulus is " + Mod);
}
}
4. public static void main(String args[])
{
String s = "Touchpad";
String s1 = "Orange;
System.out.println(s + s1);
}
E. Competency-based/Application-based questions:
1. Dilip wants to create a Java program to check whether he can vote or not. Which
type of Java statement can help him do this?
2. Your friend Naveen wants to display his name on the screen 20 times. Suggest him
a type of statement in Java which can help him do so.
93
Conditional, Looping and Jump Statements in Java

