You calculate your mean as you go along but the mean needs to be calculated at the end once you know the total value of all numbers and the count of numbers. By contrast you calculate min and max at the end, testing the same value of x repeatedly but you need to calculate min and max as you go along ...
Hi- I'm brand new to the forum and C. I hope this hasn't already been answered. I searched and couldn't find anything, but I'm probably not looking properly. Anyway, I have an assignment in which we are supposed to take a command line argument that is the name of a text file and creates a new text file with a heading ...
Consider reading the FAQ on how to get a line from the user. You're not seeing the point here: %s stops at white space. A "string" in C is a series of characters terminated by a newline. By definition then, it could include spaces. You don't say if your file has spaces other than the newlines at the end of the ...
i want to write a program (in vim editor with gcc compiler) that reads a .c file and returns the line number of a particular character.For ex 1 void function 2 { 3 ... 4 } is the function after (applying set nu) then our program should get the information like 2 is the line number of { 4 is the ...