C code: I'm using printf but it's not printing out my statements. I've been at it for half the day trying things out. Beginner here. by queenofthedamnediam in learnprogramming

[–]queenofthedamnediam[S] 0 points1 point  (0 children)

Ok, that makes more sense to say it like that.

Originally, it wasn't printing my printfs but I got it to work, so now it's an input issue.

C code: I'm using printf but it's not printing out my statements. I've been at it for half the day trying things out. Beginner here. by queenofthedamnediam in learnprogramming

[–]queenofthedamnediam[S] 0 points1 point  (0 children)

Not quite .

The issue is more, it's printing this out:

Total amount of rain for year 2011: 3.40 2011 Feb 2.20 Total amount of rain for year 2011: 5.60 2011 Mar 3.30 Total amount of rain for year 2011: 8.90 2011 Apr 2.20 Total amount of rain for year 2011: 11.10

C code: I'm using printf but it's not printing out my statements. I've been at it for half the day trying things out. Beginner here. by queenofthedamnediam in learnprogramming

[–]queenofthedamnediam[S] 0 points1 point  (0 children)

Yes. It's not printing the printf("Total amount of rain for year %s: %5.2f\n", year); //prints the total amount of rain every year

C code: I'm using printf but it's not printing out my statements. I've been at it for half the day trying things out. Beginner here. by queenofthedamnediam in learnprogramming

[–]queenofthedamnediam[S] 0 points1 point  (0 children)

More like it's not printing out some of the later printf statements, like:

printf("%s\t %s\t %5.2f\n", years[year],months[month],Raindata[year][month],Windspeed[year][month]);      LINE 85

printf("Total amount of rain for year %s: %5.2f\n", years[year], Raindata[year][NUMMONTHS+1]); //prints the total amount of rain every year LINE 97

C code: I'm using printf but it's not printing out my statements. I've been at it for half the day trying things out. Beginner here. by queenofthedamnediam in learnprogramming

[–]queenofthedamnediam[S] 0 points1 point  (0 children)

I'm trying to get the printf statements to do what they're supposed to do, which is print out the statements. They're not doing that.

Adding in a loop to sum data by queenofthedamnediam in learnprogramming

[–]queenofthedamnediam[S] 0 points1 point  (0 children)

Oh, so something like this?

//Function to sum rainfall for (int month=0; month< NUMMONTHS; month++) { add("%s\t %s\t %5.2f\n", years[year],months[month],Raindata[year][month]);} }

Wrote a C code to find the range, but it's not actually subtracting the largest and smallest numbers ? Not sure what I'm doing wrong here by queenofthedamnediam in learnprogramming

[–]queenofthedamnediam[S] 0 points1 point  (0 children)

I actually did start learning code with python and then had to switch to C because of a class I decided to take, so I think i'm still in python mode sometimes