Before seeing the solution make sure that you tried enough. Don’t paste the whole code, just find out the logic. If you stuck in trouble, just inform me on comment.
/**Bismillahir Rahmanir Rahim.**/
#include <stdio.h>
int main()
{
int s, t, f, ans;
scanf("%d%d%d", &s, &t, &f);
ans = s+t+f;
if(ans < 0) ans = 24 + ans;
printf("%d\n",ans%24);
return 0;
}
This comment has been removed by the author.
ReplyDelete