Check out example codes for "count the number of notes in a given amount c#". It will help you in understanding the concepts better.

Code Example 1

int  a[8]={500,100,50,20,10,5,2,1},m,temp,i; 
 
    printf("Enter the amount:");
 
    scanf("%d",&m);
    temp=m;
     for(i=0;i<8;i++)
    {
     printf("\n%d notes is:%d",a[i],temp/a[i]);
     temp=temp%a[i];

Learn ReactJs, React Native from akashmittal.com