Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //code to check if the number is a multiple of 3.
- //includes
- #include <stdio.h>
- #include <conio.h>
- //main thread
- int main()
- {
- int n;//local variable.
- printf("enter the value of a number",n);//enter a value of the number.
- scanf("%d",&n);
- if ( n / 3 == 1)//check if the number is divisible by 3.
- {
- printf("The number is a multiple of 3\n");//if the condition is true the print this statement.
- }
- else{
- printf("The number is not multiple of 3\n");//if the condition is false then print this statement.
- }
- }
Add Comment
Please, Sign In to add comment