Haha! That got it Stahta! atoi() truncates floating intergers, so until you get 100% interest it won't register... modified the code and the input, and it works! My first working program, thank...
Type: Posts; User: cybalicist
Haha! That got it Stahta! atoi() truncates floating intergers, so until you get 100% interest it won't register... modified the code and the input, and it works! My first working program, thank...
When I wrote this I planned on using descriptive var names, but it was faster to abbreviate on paper, and I didn't know about this forum, hindsight is 2020. Rt is running total, t is total, y is...
#include <stdio.h>
#include <stdlib.h>
int main()
{
float rt=0;
int y=0;
int yt=0;
float p=0;
float r=0;
so, changed the %.2d to %.2f, I knew that, but had forgotten, changed the y and yt variables to int's, and it runs fine, but it completely ignores the interest, the i variable...
okay, yeah, I knew about that, but I don't know about the formatting stuff for the alternative yet. I figured this was okay just for testing purposes and practice.
Okay, I caught the stdlib.h exclusion, downloaded codeblox, and built the program. It actually ran with codeblox, but it returns 0 every time, and the number of years is returned as a 8 digit...
hey, this is my first c program (yeah, helloworld wasn't challenging enough). But it gets down to a linking error... could anyone let me know what I am doing wrong?
#include <stdio.h>
int...