Computer Science, asked by ansarishahwaransari, 1 month ago

write C++ program to enter a number and check whether it is divisible by 100or not​

Answers

Answered by anindyaadhikari13
1

Required Answer:-

Question:

  • Write a program in C++ to check whether the entered number is divisible by 100 or not.

Solution:

Here comes the program.

#include <iostream>

using namespace std;

int main() {

int a;

cout << "Enter a number: ";

cin >> a;

if (a%100==0)

    cout << "Number is divisible by 100.";

else

    cout << "Number is not divisible by 100";

return 0;

}

Algorithm:

  1. START.
  2. Accept the number.
  3. Divide the number by 100 and find the remainder.
  4. If the remainder is zero, number is divisible by 100 else not.
  5. Display the result.
  6. STOP.

See the attachment for output ☑.

Attachments:
Similar questions