Computer Science, asked by ICSEgirl, 1 year ago

write a java program to display all the 'buzz numbers' between p and q (where p is less than q).A 'Buzz Number' is the number which ends with 7 or is divisible by 7.


Anonymous: my icse exam completed some days before

Answers

Answered by Monika010
45
find the attachment!!!☺️
Attachments:

Anonymous: Are aap simile kse bej rhin h
Anonymous: mre p send n Ho rhi
Monika010: type in english
Monika010: brainly doesn't accept emoji s
Anonymous: ohhho thanks
Monika010: ya
Anonymous: I am also how exam passed
Anonymous: my very well
Monika010: this year i will write exam
Answered by shreeyabalaji06
21

Answer:

import java.util.Scanner;

public class Buzz_no

{

   public static void main(String args[ ])  

   {

       Scanner in = new Scanner(System.in);  

       int p,q,i;

       System.out.println("Note: p should be less than q");

       System.out.print("Enter p: ");

       p=in.nextInt();

       System.out.print("Enter q: ");

       q=in.nextInt();

       System.out.println("Buzz numbers between "+ p + " and " + q);

       for (i=p;i<=q;i++)

      {

           if (i%10==7 || i%7==0)

           {

               System.out.println(i);

           }

      }        

   }

}

Similar questions