Saved Bookmarks
| 1. |
Q.11 Find the total amount?2 notes of 20000 |
|
Answer» /* C PROGRAM to Count Total Notes in a Given Amount */ #include
int main() { int a[8] = {500, 100, 50, 20, 10, 5, 2, 1}; int Amount, i, temp;
PRINTF("\n Please Enter the Amount of Cash = "); SCANF("%d", &Amount);
temp = Amount;
for(i = 0; i < 8; i++) { printf("\n %d Notes is = %d", a[i], temp / a[i]); temp = temp % a[i]; } return 0; } |
|