ii)Display multiples of 5 between the number (minus) -10 and 20 using while loop.
Answers
Answered by
1
Answer:
import java.util.Scanner ;
public class main
{
public static void main()
{
Scanner sc = new Scanner(Sustem.in) ;
sop("“Enter a number"”) ;
int n = sc.nextInt() ;
int r1 = -10 ;
while(r1 <= 20)
{
if(r1 % 5 == 0)
{
sop(r1) ;
}
r1 = r1 + 1 ;
}
}
}
Explanation:
Easy
Similar questions