write C++ program to enter a number and check whether it is divisible by 100or not
Answers
Answered by
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:
- START.
- Accept the number.
- Divide the number by 100 and find the remainder.
- If the remainder is zero, number is divisible by 100 else not.
- Display the result.
- STOP.
See the attachment for output ☑.
Attachments:
Similar questions
Math,
22 days ago
Science,
22 days ago
Computer Science,
22 days ago
English,
1 month ago
Hindi,
1 month ago
Social Sciences,
7 months ago
Geography,
7 months ago
Science,
7 months ago