Alx09

Untitled

Apr 16th, 2020
782
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4.  
  5.  
  6. int main() {
  7. unsigned a, b, c, i , mult = 0;
  8. printf("a= "); scanf("%u", &a);
  9. printf("b= "); scanf("%u", &b);
  10. printf("c= "); scanf("%u", &c);
  11. if (c > 30) {
  12. printf("Date introduse gresit");
  13. return 0;
  14. }
  15. for (i = 1; (mult|( 1 << i * c)) <=(1 << b); i++) {
  16. mult |= 1 << i * c;
  17. }
  18. a = 1 << a;
  19. b = 1 << b;
  20. while (a <= b) {
  21. if ((a & mult) == mult)
  22. printf("%u", a);
  23. a++;
  24. }
  25. system("pause");
  26. return 0;
  27. }
Advertisement
Add Comment
Please, Sign In to add comment