Advertisement
hkshakib

Untitled

Jun 26th, 2019
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. int main()
  4. {
  5. int n;
  6. cin>>n;
  7. if(n%4==0)
  8. {
  9. cout<<n<<endl;
  10. return 0;
  11. }
  12. else
  13. {
  14. int temp=n,sum=0;
  15. while (n)
  16. {
  17. int k = n % 10;
  18. sum += k;
  19. n /= 10;
  20. }
  21. if(temp%4==0)
  22. {
  23. cout<<temp<<endl;
  24. return 0;
  25. }
  26. temp=n+1;
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement