Hi, im new to the forums, and im new to C Programming. I have a program I have been working on that has many parts. My professor doesnt really go over anything he assigns. So the problem is to have a user enter a long number (ex. 1024), and then output it in two ways, 1. formatted with commas 1,024, and 2. were suppose to take the number in as an amount of bytes and convert and display it back as something like 1KB. Im not worried on the 2nd part, I will just be using if and for loops. I am just stuck on how to write a function to format a number with commas. ***We have only gone over arrays, functions, types, loops, and expressions*** I was trying to think of a way to do it with arrays or strings(next chapter), but i cant not seem to think of how to do it. All it has to be is a function I can use to format the number with commas. Thanks for any help!
I know you use a printf and scanf to get the number, just no clue on how to format that number with commas using a function.