You made one suggestion to me (line 14 of my code), which I implemented. I then started to write my reply to you. After I posted the reply, I saw anduril's comment, and edited my reply, saying that...
Type: Posts; User: seanksg
You made one suggestion to me (line 14 of my code), which I implemented. I then started to write my reply to you. After I posted the reply, I saw anduril's comment, and edited my reply, saying that...
I actually read your first comment after changing my code based on only Tater's first suggestion. I will check back when I get time to add in the rest of the suggestions.
I implemented that, but it doesn't seem to be going any faster.
Evaluating the same number (600851475143) with a program that only determines whether it's prime returns a result instantly.
So...
Hi all,
I'm currently working on a Project Euler challenge calling for me to find the largest prime factor of a given number. I have a working code written (I know it works, as I've tested it...
Ah I see. I just did upon your suggestion, but had only read what my textbook said before. I think I'm going to stray from this text from now on... at least when it is instructing me in how to use...
Nope, just two. I guess you and I both saw the "==" error at the same time. Andwhy rand()? Won't that produce the same value every time?
Also, thanks for the FAQ suggestion... I was following an...
Hi,
I'm trying to write a simple program to roll a die. So far, here is what I have:
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
#include <ctype.h>
#include <string.h>
#define TRUE 1
#define FALSE 0
int pal(char *input);
Ah that makes more sense. Thanks! I'll try that out.
My roommate just suggested that to me. It seems to make the most sense. I'm assuming I'd use something like strcpy(). But how would i keep from copying the unwanted characters?
That's correct
Hi,
So I am writing a program that checks to see whether a string input by the user is a palindrome or not. Part of the problem involves ignoring any character that isn't a letter when verifying...
Duly noted... I'll spend some more time on the faqs and see if I can't decipher them a bit more.
Just read this post... I put the getchar() into my code. So I'm led to believe that my problem...
I honestly agree. I was very upset having learned that my prof gave me code that doesn't work. Saying that I would just stick to my professor for help was a frustrated response. I do want to learn...
To both quzah and commontater, thank you for the help,
quzah, i wasn't ignoring you. the faqs you pointed me to were informative, but this is a class assignment, and the faqs suggested commands...
I can't tell if you're being sarcastic. The internet kind of prevents that. But if you are. Why? I'm new to C programming, and am just trying to learn... no need to be a dick.
If not, sorry...
I removed the fflush(stdin). It now allows me to enter a "y" or an "n", but when I press enter afterwards, it terminates the program, rather than restarting the loop. Is it because of using the...
Hi all,
I recently started writing a program that generates a random number, then gives the user four chances to guess the number. Upon either a correct guess, or upon using all four chances, the...
Hi all,
I'm just learning C, and I started playing around with the double argument type. So I wrote a simple print/scan/print program to see how it works. My code is below.
#include...
Brilliant!
It's all working now. Thanks for all the help! I can't thank you enough.
I looked into else...if statements (next section in my book)... and developed the following code. However, I'm still having some issues.
#include <stdio.h>
#include <stdlib.h>
#include...
Thanks for the help! My roommate tried to explain nesting to me (he's far more versed in programming than I, but doesn't know C). We just couldn't figure out off the bat how to do that. I'll try...
Correct... still only in week 2 of classes. I figure that we will probably go over something to that effect sometime this week (assignment isn't due until next week). I just figured I'd be...
Hi all,
I'm new to these boards, and programming in general. In fact, C is my first language. Earlier today, my instructor gave an assignment that called for a program that, upon the input of 4...