TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
Loading...
Searching...
No Matches
buzz_number.cpp File Reference

A buzz number is a number that is either divisible by 7 or has last digit as 7. More...

#include <iostream>
Include dependency graph for buzz_number.cpp:

Go to the source code of this file.

Functions

int main ()
 

Detailed Description

A buzz number is a number that is either divisible by 7 or has last digit as 7.

Definition in file buzz_number.cpp.

Function Documentation

◆ main()

int main ( void )

main function

Definition at line 9 of file buzz_number.cpp.

9 {
10 int n, t;
11 std::cin >> t;
12 while (t--) {
13 std::cin >> n;
14 if ((n % 7 == 0) || (n % 10 == 7))
15 std::cout << n << " is a buzz number" << std::endl;
16 else
17 std::cout << n << " is not a buzz number" << std::endl;
18 }
19 return 0;
20}