Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(){
- int a,b;
- printf("Enter a number: ");
- scanf("%d", &a);
- printf("Enter your choice: ");
- scanf("%d", &b);
- switch(b){
- case 1:
- if(a%7==0)
- printf("Divisable by 7");
- else
- printf("Not divisable by 7");
- break;
- case 2:
- if (a>=0)
- printf("The number is not negetive");
- if (a<0)
- printf("The number is negetive");
- break;
- case 3:
- if((a>100)&&(a%3!=0))
- printf("Greater than 100 and not divisable by 3.");
- break;
- default:
- printf("invalid input.");
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement