A number is said to be Buzz Number if it ends with 7 OR is divisible by 7.
The task is to check whether the given number is buzz number or not.
Input : 63 Output : Buzz Number Explanation: 63 is divisible by 7, one of the condition is satisfied. Input : 72 Output : Not a Buzz Number Explanation: 72 % 7 != 0, 72 is neither divisible by 7 nor it ends with 7 so it is not a Buzz Number.
Buzz Number Not a Buzz Number
Time complexity : O(1) as there are atomic statements and no loops.
This article is contributed by Nikita Tiwari. If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- C Program to check whether a number is a Perfect Cube or not
- Python program to check whether a number is Prime or not
- Check whether a given number N is a Nude Number or not
- Check whether a given number is an ugly number or not
- Check whether the binary equivalent of a number ends with given string or not
- Check whether triangle is valid or not if sides are given
- Check Whether a number is Duck Number or not
- Check whether the number formed by concatenating two numbers is a perfect square or not
- C program to check whether a given number is even or odd
- Check whether a point lies inside a sphere or not
- Check whether a + b = c or not after removing all zeroes from a,b and c
- Check whether the Average Character of the String is present or not
- Check whether a Matrix is a Latin Square or not
- C program to Check Whether a Number is Positive or Negative or Zero
- Program To Check whether a Triangle is Equilateral, Isosceles or Scalene
- Check whether given floating point number is even or odd
- Check whether the given character is in upper case, lower case or non alphabetic character
- Check whether the number can be made perfect square after adding K
- Check whether the number can be made palindromic after adding K
- Check whether count of odd and even factors of a number are equal
Improved By : nitin mittal