Advertisement
iipq

Untitled

Nov 12th, 2014
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. #include <stdio.h>
  2. int main(){
  3. int a,b;
  4. printf("Enter a number: ");
  5. scanf("%d", &a);
  6. printf("Enter your choice: ");
  7. scanf("%d", &b);
  8.  
  9. switch(b){
  10. case 1:
  11. if(a%7==0)
  12. printf("Divisable by 7");
  13. else
  14. printf("Not divisable by 7");
  15. break;
  16. case 2:
  17. if (a>=0)
  18. printf("The number is not negetive");
  19. if (a<0)
  20. printf("The number is negetive");
  21. break;
  22. case 3:
  23. if((a>100)&&(a%3!=0))
  24. printf("Greater than 100 and not divisable by 3.");
  25. break;
  26. default:
  27. printf("invalid input.");
  28. }
  29. return 0;
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement