Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main(void){
- int n;
- int m=0;
- do{
- printf("Irjon be egy szamot:\n");
- scanf("%d", &n);
- } while(n<0);
- if (n%2==0){
- m=2;
- }
- if(n%3==0){
- m=3;
- }
- if(n%6==0){
- m=6;
- }
- switch(m){
- case 2:
- printf("%d oszthato %d\n", n, m);
- break;
- case 3:
- printf("%d oszthato %d\n", n, m);
- break;
- case 6:
- printf("%d oszthato %d\n", n, m);
- break;
- default:
- printf("%d nem oszthato\n", n);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement