0% found this document useful (0 votes)
12 views2 pages

Sleep

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views2 pages

Sleep

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

/******************************************************************************

Welcome to GDB Online.


GDB online is an online compiler and debugger tool for C, C++, Python, PHP, Ruby,

C#, OCaml, VB, Perl, Swift, Prolog, Javascript, Pascal, COBOL, HTML, CSS, JS
Code, Compile, Run and Debug online from anywhere in world.

*******************************************************************************/
#include <stdio.h>

int sleepTime = 431022;

int timeDecode(int timeNum)


{
int tempNum = timeNum;
if (tempNum >= 16384) {
tempNum -= 16384;
printf("Subtracted : 16384\n");
}else if (tempNum >= 8192) {
tempNum -= 8192;
printf("Subtracted : 8192\n");
} else if (tempNum >= 4096) {
tempNum -= 4096;
printf("Subtracted : 4096\n");
} else if (tempNum >= 2048) {
tempNum -= 2048;
printf("Subtracted : 2048\n");
} else if (tempNum >= 1024) {
tempNum -= 1024;
printf("Subtracted : 1024\n");
} else if (tempNum >= 512) {
tempNum -= 512;
printf("Subtracted : 512\n");
} else if (tempNum >= 256) {
tempNum -= 256;
printf("Subtracted : 256\n");
} else if (tempNum >= 128) {
tempNum -= 128;
printf("Subtracted : 128\n");
} else if (tempNum >= 64) {
tempNum -= 64;
printf("Subtracted : 16384\n");
} else if (tempNum >= 32) {
tempNum -= 32;
printf("Subtracted : 32\n");
} else if (tempNum >= 16) {
tempNum -= 16;
printf("Subtracted : 16\n");
} else if(tempNum >= 8){
tempNum -= 8;
printf("Subtracted : 8\n");
}
else
{
printf("Sub Remain : %d\n",tempNum);
tempNum-=tempNum;

if(tempNum>0)
{
// printf("num : %d\n",tempNum);
timeDecode(tempNum);
}
else if(tempNum<=0)
{
return 0;
}

int main()
{
timeDecode(sleepTime);
return 0;
}

You might also like