Guest User

Untitled

a guest
Jul 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. //code for divisibility by 7.
  2. //includes
  3. #include<stdio.h>
  4. #include<conio.h>
  5. //main thread
  6. int main ()
  7.  
  8. {
  9. int a,b=7;//local variable.
  10. printf("enter the value of a ");//ask for the number of terms.
  11. scanf("%d",&a);
  12. if (a%b == 0)//check if remainder is zero or not.
  13. { printf("a is divisible by 7");//if true print this.
  14. }
  15. else
  16. {
  17. printf("a is not divisible by 7 ");//if false print this.
  18. }
  19.  
  20.  
  21. }
Add Comment
Please, Sign In to add comment