I don't know how to explain this, but I'll try. Say a = 0 and then I did a++, a would go up 1 every cycle in the loop. That is with an integer. I have no clue on how to get it to go up one letter...
Type: Posts; User: PYROMANIAC702
I don't know how to explain this, but I'll try. Say a = 0 and then I did a++, a would go up 1 every cycle in the loop. That is with an integer. I have no clue on how to get it to go up one letter...
When I said I don't understand how the loop would work, I meant I don't know how to implement the loop for my situation. I know how to do a loop. The part I don't understand is how to go from one...
By "taking forever" I did mean for me to type the code.
I could do that, but I don't understand how the loop would work.
I'm trying to make a typing animation in my C program, but it's taking forever because I have to use the sleep() function after every letter. Writing something long seems impossible. If I have to...
Oh yeah... z was used in my old code and I just forgot to remove it.
#include <stdio.h>
#include "strlib.h"
#include "genlib.h"
#include "simpio.h"
main()
Sorry about that. I just had no clue on what to name them.
wow, thanks. I didn't think it would be that simple. I simply just replaced z with i in the if statement and assigned g to i in before the while statement. It looks like this.
#include <stdio.h>...
Everything is explained in the program on how it works. However, when compiled, it doesn't display the longest string. It displays the string I last entered. For example if I enter "What" "kind" "of"...
I have used everybody's suggestions and I finally got it to work. Andrew - I do read, but in the examples I didn't understand what mod meant. I just declared rem in the while statement and it now...
That is exactly what I am doing. Also, for the third time, it's greatest common DIVISOR! Please correct me if i'm wrong, but my code seems to be doing exactly that. If not, could you post some code...
That is exactly what the assignment tells me to do... It tells me to assign num2 to num1 and assign rem to num2, then loop, so when rem = 0, the loop terminates. Also it's not denominator, it's...
#include <stdio.h>
#include "genlib.h"
#include "simpio.h"
main()
{
int num1, num2, rem, GCD;
printf ("This program calculates the GCD of two numbers.\n\n");
I should have clarified, GCD is Greatest Common Divisor. Anyways, after assigning rem (remainder) to num1 % num2, it is still an infinite loop.
I have an assignment to use the euclid method to solve the GCD of two integers. Here is what I have so far:
#include <stdio.h>
#include "genlib.h"
#include "simpio.h"
main()
{
Ok, I did what you told me too and it "kind of" worked. I can't do a continuous if, else if , else because then it won't work. Here's what I did, which still doesn't work in one occasion.
...
No, I do not... As I already stated, I am a programming noob. I'm only in my first class.
I haven't learned return statements yet. How would I structure it right?
I'm getting the error "too few arguments to function 'exit'."
Matticus, I don't understand.
Thanks, but the exit statement isn't working. Here is my code:
#include <stdio.h>
#include <math.h>
#include "genlib.h"
#include "simpio.h"
main()
I'm a noob at C and I need to know how to end the program in the middle so it won't do any more steps. I'm not using loops so break won't work. Please help!
No, I just really wanted to learn how to program so I signed up. It's all year round, but you buy each class. This one is for 3 months and It ends August 1st.
GREAT! Thank you guys so much!!!
I understand your frustration. I am a coding newbie (as you can tell) and everything you say to me really means a lot and I respect every word that you say. I added the part you told me to in the...
EDIT: And of course this:
I'm sort of confused on this one. Are you talking about max = 0? If I don't have that then the program doesn't work.
EDIT: I get it now.
#include <stdio.h>...