I am a beginner in programming and I am trying to understand a code that converts decimal to binary. The code is as follows:
#include <stdio.h>
int main()
{
long int DN,quo;
int rem[106],i=1,j;
printf("give me a decimal number: ");
scanf("%ld", &DN);
quo = DN;
while(quo!=0)
{
rem[i]= quo % 2;
quo = quo / 2;
i++;
}
printf("Equivalent binary value of your decimal number %ld\n: ",DN);
for(j = i-1 ;j> 0;j--)
printf("%d",rem[j]);
}
Can anyone help me understand the part beginning with the while loop? I am very sorry for posting such a simple question.