[
#include <stdio.h>
int main ()
/* Declare and initialize variables. */
int number1 = 4, number2 = 7, sum;
/* Calculate sum. */
sum = numberl + number2;
/* Print the sum. */
printf("The...
Type: Posts; User: ralphwiggam
[
#include <stdio.h>
int main ()
/* Declare and initialize variables. */
int number1 = 4, number2 = 7, sum;
/* Calculate sum. */
sum = numberl + number2;
/* Print the sum. */
printf("The...
Thanks to both of you. I feel very stupid.
Problem solved.
Okay. . .tried it and it did not tell me anything. It no longer displays anything after it executes.
#include <stdio.h>
#include <errno.h>
int main(void)
{
FILE *scores;
int score;
I'm an idiot.
It's worked for me in the past but I will do it.
I do care. I have read over my 3 previous threads and do not understand what using system is and I googled it "system" +problems +"C language" and "system +"C language" & I found nothing...
I have a list of positive integers in a file called "scores.txt" that is located on my C drive at the address I listed in the program.
I have been given this program by my instructor to open the...
Thank you
I am saving this thread
n must be a positive integer
Outer loop executes n times
Inner loop executes the current i # of times before it exits and the outer loop increments by one and retests condition and if true (i<=n)...
quzah & risby Okay you are right and I mean no disrespect. I was trying to understand the nature of the relationship between the outer & inner loops and I have read over the lesson and read 2...
I am new to the forum and I was hoping for a new insight.
I did not mean to bother you.
I will not abuse the ettiquete of the forum, but please understand I am learning.
I straightened it out and I appreciate you all's comments.
I want to say more but it's just stupid sentiment.
Thanks I have learned a lot.
There are so many I am reluctant to list them.
I have eliminated main () from the others and just put one on the top or do I need to put main () above every new program?
20 syntax error before...
This is the best I can do right now & the compiler highlights the bracket of the second program. This is actually more interesting than I thought. Thank you quzah.
I am going to apologize ahead of...
I need to combine these programs into one program that works for a positive integer "n"
The first is a sum of squares starting with 1 until "n"
The second is a sum of cubes starting with 1 until...
The program asks you to pick an integer "n" which based on the initializations of "i=1" & "j=1" must be positive for the 2 loops to even execute.
Based on the structure i loops (n-1 times) and the...
The program asks you to pick an integer "n" which based on the initializations of "i=1" & "j=1" must be positive for the 2 loops to even execute.
Based on the structure i loops (n-1 times) and the...
The program was written by someone else and I am to figure out the value of "sum" at the end of the program and justify my answer.
Thanks quzah. I will get down to the brass tacks after I go for a...
This is a set of nested for statements.
The program asks you to pick an integer "n" which based on the initializations of "i=1" & "j=1" must be positive for the loops to even execute.
I would say...
Never mind the multiple lines. they are not appearing now.
OOps. . my bad. . .I need to start i off as 1.
Thanks you guys.
this forum rocks and youse guys altruism is admirable.
bivhitscar & SKeane
it is the right answer. . .it just has a "1" in front of it.
I just need to strip that off.
Do "do while" loops mandate multiple lines when the output displays?
Gotcha . . .I edited that post above multiple times so I've got my specifiers lined up now.
It's getting there, but my output is (when n = 3)
it displays 4 lines "The sum. . .is 1.0000"
"The sum....
SKEane
You are right. . .thanks. Man I am sloppy!
bivhitscar
Sorry am changing my code right now per your suggestion
EVen with that (float) it still displays that number
Damn I need to...
Har-Har so wikipedia has an article on Ralph. It is hilarious. It also preserves the humor which I think is special because so often when you seek to dissect something it dies in the process. ....
bivhitscar
You are definitely NOT an idiot. Your corrections have been spot on.
My preprocessor directives were misspelled but I changed that.
I put one more parenthesis and it compiles and...
Damn Wiggum. . .I am particularly fond of him.
thanks for the corrections
The compiler reads 2 lines I put in in the code box. i guess I don't need code but it looks better
In...