MeetCode
Divisible By 3
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Run
Submit
Dark
Problem Statement
Solutions
Submissions
Divisible By 3
Easy
Computer Mathematics
Integers & Divisibility
35 views
Explanation
Complexity
Problem Statement
Check if a number is divisible by 3 and print YES/NO.
Input Format
One integer n.
Output Format
YES or NO.
Example
Input
21
Output
YES
Constraints
|n|
Input / Output Format
Input Format
One integer n.
Output Format
YES or NO.
Constraints
|n|
Examples
Input:
21
Output:
YES
Example Solution (Public)
Computer Mathematics
Compute n % 3. If result is 0 print YES else NO.
Official Solution Code
Wrap
Copy
Compute n % 3. If result is 0 print YES else NO.
Please
login
to submit solutions.
Editor
C
C++
Computer Mathematics
CSS
DSA
HTML
Java
JavaScript
NodeJS
PHP
Programming Interview
Python
ReactJS
SQL
Test Cases
Output
Submission Result
Input
21
Expected Output
YES
Compile Output
Error
Output
Please
login
to submit solutions.