Empowering CS learners, aspiring programmers, and startups with AI, Data Science & Programming insights — scaling skills from learning foundations to enterprise-grade solutions.
#include <stdio.h>
#include <cs50.h>
int main(void)
{
int t = get_int("enter cents");
int count25 = t / 25;
int count10;
t = t % 25;
printf("count25 is %i\n", count25);
printf("remaining t after count25 %i", t);
if (t > 9)
{
count10 = t / 10;
}
else
{
count10 = 0;
}
printf("count10 is%i\n", count10);
int totalcoins = count25 + count10;
printf("total coin count%i\n", totalcoins);
}
[/dm_code_snippet]
Cash project prepares one to start using functions in programming. However, the same can be also done without creating functions through the main function.