Can someone do one of the task in C. You are to write and execute code for the f
ID: 3887133 • Letter: C
Question
Can someone do one of the task in C.
You are to write and execute code for the following problems. When you are done, capture a screenshot of output and turn it in with the source code via Blackboard. Assume notes $100, $50, $20, $5 and $1. Write a program that reads the amount and prints how many notes we need to pay out this amount. An example of input: 186 The corresponding output: 1 times $100 1 times $50 1 times $20 3 times $5 1 times $1 Write a program that reads the number of day and which day in week it is and then another number of day and prints which day in week it is. For example, the program reads that day 1 (January 1^st) is Sunday and computes that day 39 (February 8^th) is Wednesday. Use 0 for Sunday, 1 for Monday, and so on. The input is the number of day, the day in week, and another number of day. An example of input: 10 39 The corresponding output: WednesdayExplanation / Answer
#include<stdio.h>
Answer to task 1:
int main() {
int total, i, n;
int den[5] = {100, 50, 20, 5, 1};
printf("Enter total amount: ");
scanf("%d", &total);
for (i = 0; i < 5; i++) {
n = total/den[i];
printf("%d x $%d ",n, den[i]);
total = total% den[i];
}
}