Computer Science, asked by visheshp69, 5 months ago

write a program in c++ to enter a number and find out it is a buzz number or not.​

Answers

Answered by Anonymous
0

Explanation:

int n; cout<<“Please enter a number: “; cin>>n; The number to be tested is collected from the user.

if(n%7 == 0 || n % 10 == 7) cout << n << ” is a buzz number “<<endl; ...

else cout << n << ” is not a buzz number “<<endl;

Answered by ғɪɴɴвαłσℜ
2

C++ Programme :-

#include <cmath>

#include <iostream>

using namespace std;

// function buzz number

bool isBuzz(int num){

return (num % 10 == 7 || num % 7 == 0);

}

int main(){

int num = 63;

if (isBuzz(num))

cout << "its a buzz Number\n";

else

cout << "its a buzz Number\n";

}

int main(){

int num = 39;

if (isBuzz(num))

cout << "its a buzz Number\n";

else

cout << "its not a buzz Number\n";

}

Output :-

number: 63

it’s a buzz number

-------------------------------------

number: 39

it’s not a buzz number

A bug number is a number which can be devided by 7.

_______________________________________

Similar questions