+ 1
What's wrong with my logic
If I give 3 and 9 out will be give away same as if I give 10 20 also say give away but output showing eat them yourself why? #include <stdio.h> int main() { int siblings, popsicles; scanf("%d", &siblings); scanf("%d", &popsicles); //your code goes here siblings = siblings % popsicles; if(siblings ==0){ printf("give away"); } else{ printf("eat them yourself"); } return 0; }
2 Antworten
+ 5
It should be popsicles % siblings.
Make this change and it should work.
+ 2
Thanks bro I didn't notice that