Ah! Thanks a lot!
Type: Posts; User: kabuatama
Ah! Thanks a lot!
Okay, I figured that out. Thanks for the help. I have a new problem though, which should be easy for anyone who isn't me to figure out. I have the user enter his first and last name and favorite...
Is there a way to find if a number is in an array more than once? How would I go about doing this? Thanks for the help.
I knew it was something dumb. Thanks a lot!
Okay, one more question. Is there a way to compare two strings to see if they two strings are the same?
Edit:
I figured out how to compare two...
The last part of my code which is supposed to print out the word if x is greater than j, will not print out.
#include <stdio.h>
#include <string.h>
int main(void)
I checked, but still do not understand how to sort the array. Most examples have the array with numbers already entered, but in my program, the user enters up to 10 numbers, or presses 0 to quit. ...
Thanks a lot. But I have another question. Is there a way to make it so that all the numbers will print out from smallest to largest? All that gives me is the smallest number every time.
Is there an easy way to find a minimum value in an array? Thanks.
I now understand how to test for a number. The problem I am having now is how to simply skip the input if a non-number is entered. Please help me out on this. Thanks.
Edit:
I figured this...
I checked the FAQ but still couldn't find it. Very sorry, but does anyone have any specific help? It would be greatly appreciated. Thanks.
Is there a way to prompt a user for a number, but if the user enters a character such as a letter, to just skip that entry? If it helps, here is the code I have so far:
#include <stdio.h>...
I've gotten most of it figured out. What I need help with is printing all the numbers between the numbers entered. This means that if the two numbers entered were "2" and "5," 3 and 4 would print...
isdigit( ) did help, and I seem to have the numbers working (I just hope I did it correctly). This is what I have so far:
char str[256];
int start;
int num;...
I understand how to store the number using getchar (). The problem I am having is validating the number when using getchar (). This is what I need help with. Thank you for helping, though.
I'm sorry, I don't understand. I tried it like this:
do {
error = 0;
printf("Please enter an integer\t");
int charVal = getchar();
Hello. For my assignment, my teacher wants me to get 2 numbers from the user, and then valide them. He wants us to use getchar( ). I can get most of it to work using scanf, but using getchar...
I am using the bloodshed dev whatever compiler. And the reason I have the beginning wrong is because once again, my teacher wants us to use that format. And for the return 0, my compiler will not...
It works! Thank you so much! And for the idiot teacher remark, yeah, I guess his teaching methods are a little weird. He did give us notes for this week, but the notes were on loops and if...
Well, my teacher wants us to use the Void Main(void), and also I did forget the last brace when I posted my code. It compiled, but I kept getting an answer of "0." Now, I figured out the long, but...
Yes, and I wrote the program. I do not understand why I keep getting a value of "0;" it should work.
I am truly sorry, but I have never come across a long datatype before. My book does not explain this, so I have been checking numerous websites and the FAQs on this site to try to better understand...
Here is my code so far. I got the string part to work, but am still having trouble with the exponents. What am I doing wrong?
#include <stdio.h>
#include <math.h>
void main(void)
{
...
Unfortunately, I do not go to classes for my class. Basically I have an assignment due each week, and I am on my own to learn it. I have looked in the book, and I know that long integers are whole...
Are these just regular numbers, such as 1, 2 ,3, etc.? Or are they something different? I need to make a code that accepts two long integers, then raises one to the power of the other.
Edit:
...
That is all I need to do? I've been trying many different things, such as
if ((number % 2) == (number / 2))
I did not realize that it was so simple. Thanks a lot for your help!