c++ program - to enter a number and check whether it is divisible by 100 or not
Answers
Answered by
1
Language:
C++
Program:
#include <iostream>
using namespace std;
int main () {
int n;
cout << "Enter the number: ";
cin >> n;
if (n%100==0) { cout << "It's divisible." ;}
else { cout << "It's not divisible." ;}
return 0; }
Output:
In the attachment.
Explanation:
- cin accepts input values in a varibale.
- cout prints the output on screen.
Attachment:
( On top if you're using the app and below if you're on website)
Attachments:
Similar questions
English,
1 month ago
Psychology,
1 month ago
Computer Science,
1 month ago
English,
2 months ago
Physics,
8 months ago
English,
8 months ago