Computer Applications
Give the output of the snippet:
int p = 9;
while (p<=15)
{
p++;
if(p== 10)
continue;
System.out.println(p);
}
Java
Java Iterative Stmts
48 Likes
Answer
11 12 13 14 15 16
Answered By
23 Likes
Related Questions
Predict the output:
int a=6,b=5; a += a++ % b++ *a + b++* --b;
Give the output of the snippet:
int a=10,b=12; if(a==10&&b<=12) a--; else ++b; System.out.println(a + "and" +b);
An Electricity Board charges for electricity per month from their consumers according to the units consumed. The tariff is given below:
Units Consumed Charges Up to 200 units ₹3.80/unit More than 200 units and up to 300 units ₹4.40/unit More than 300 units and up to 400 units ₹5.10/unit More than 400 units ₹5.80/unit Write a program to calculate the electricity bill taking consumer's name and units consumed as inputs. Display the output.
The equivalent resistance of series and parallel connections of two resistances are given by the formula:
(a) R1 = r1 + r2 (Series)
(b) R2 = (r1 * r2) / (r1 + r2) (Parallel)
Using a switch case statement, write a program to enter the value of r1 and r2. Calculate and display the equivalent resistances accordingly.