filmov
tv
Java Tutorials 30 - Do-While Loop
Показать описание
This video covers the purpose and use of do-while loop.
Assignment:
Watch video on loops :
Java quick primer and basics for anyone who wants to learn java whether students or professionals, experienced or laterals.
Code for above video :-
import java .util.*;
public class DoWhileDemo
{
public static void main()
{
/**
* Display menu to user and ask their choice :
* 1. Add 2 nos
* 2. Entered no even or odd
* 3. Find if triangle can be formed when 3 sides of triangle taken as input
* Continue the above operations till user enters NO.
*/
char ch = 'N';
do{
switch(choice)
{
break;
if(n3%2==0)
else
break;
if(s1+s2 > s3 && s2+s3 > s1 && s1+s3 > s2)
else
}
}while(ch=='Y');
}
}
Assignment:
Watch video on loops :
Java quick primer and basics for anyone who wants to learn java whether students or professionals, experienced or laterals.
Code for above video :-
import java .util.*;
public class DoWhileDemo
{
public static void main()
{
/**
* Display menu to user and ask their choice :
* 1. Add 2 nos
* 2. Entered no even or odd
* 3. Find if triangle can be formed when 3 sides of triangle taken as input
* Continue the above operations till user enters NO.
*/
char ch = 'N';
do{
switch(choice)
{
break;
if(n3%2==0)
else
break;
if(s1+s2 > s3 && s2+s3 > s1 && s1+s3 > s2)
else
}
}while(ch=='Y');
}
}