Search:

Type: Posts; User: jaja009

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    6
    Views
    1,157

    So basically, in the printf cases, I plug that...

    So basically, in the printf cases, I plug that number in as 'a' down in the definition of the function? If so, then the first three 4, 6, and 8 values are all below 5...which I think would make sense...
  2. Replies
    6
    Views
    1,157

    Well, the output is correct according to the...

    Well, the output is correct according to the example in the book, my problem is that I dont understand how the program came to that conclusion.
  3. Replies
    6
    Views
    1,157

    Switch and case problem.

    #include <stdio.h>

    int fx(int a);

    int main(void)
    {
    int x;

    printf("Enter an integer: ");
    scanf("%d", &x); /* assume user enters 5 */
  4. Replies
    4
    Views
    1,266

    Ok, I think I understand it now. So there arent...

    Ok, I think I understand it now. So there arent any real values for a & b, and instead left and right represent 2 & 3.
    So basically in order, the program goes,

    The program prints "1 , 1" for...
  5. Replies
    4
    Views
    1,266

    Can someone explain this program to me?

    #include <stdio.h>

    int left(int a);
    int right(int b);

    int main(void)
    {

    int n = 1, x = 1;
  6. Yeah I realized that earlier. I meant to change...

    Yeah I realized that earlier. I meant to change that. When it was -1 my total would be +1 of what it should be. And the upper limit is 1000, I used Microsoft Word to count. But everything is correct...
  7. OMG!! XD Thanks man! I added a "count = 0" just...

    OMG!! XD Thanks man! I added a "count = 0" just below the "integer++;" and it works! Its little stuff like that that I always forget!

    (added the corrections to the code above, and everything works...
  8. Nearly finished, but a single problem remains.

    Hey guys, I want to thank you for all the help you've given me before, but I have another question.
    This code I'm working on isnt counting the integers within the array correctly:


    #include...
  9. Replies
    6
    Views
    1,975

    Sorry, I've fixed it now. To make sure I...

    Sorry, I've fixed it now.


    To make sure I understand, you set the total array to the same amount of numbers as data array, and the "i" increments upward, and the total will count how many of...
  10. Replies
    6
    Views
    1,975

    thanks, count is now initialized to 0. Ugh,...

    thanks, count is now initialized to 0.

    Ugh, I'm still making noob mistakes. While that does address one of my problems, I still get the wrong output.
  11. Replies
    6
    Views
    1,975

    Mesmerizing Array problem

    Hey guys, I require a bit of assistance. My goal is to get my program to read an array of 1000 integers all ranging 0-99; it then has to list the integers in a column 0-99, count and display the...
  12. Ok, I've tried that, but for some reason, the...

    Ok, I've tried that, but for some reason, the count is giving me 1000. Its detecting how many variables are in the array but arent specifically counting the ones that are inputted as &n. I changed...
  13. Replies
    3
    Views
    9,786

    Thanks. I see I made some pretty dumb mistakes....

    Thanks. I see I made some pretty dumb mistakes. I've only recently started using 'double' and forgot it doesnt work with %d. I've made the changes to my code, and tried yours, but I get this weird...
  14. Replies
    3
    Views
    9,786

    Storing and printing an array table

    This is what I'm supposed to store as an array:


    So the code I currently have is:

    #include <stdio.h>

    int main(void)
    {
    int i;
  15. Thanks for the help Ultraking, but I dont think I...

    Thanks for the help Ultraking, but I dont think I did it correctly, have a look:

    #include <stdio.h>
    #include <stdlib.h>

    int main(void)

    {
    int data[1000] = {9, 71, 39, 97, 91, 61, 95, 17,...
  16. How to search an array for certain numbers and count them.

    Hey guys, just like the title says, I'm having a little trouble getting my program to search an array for certain numbers and count them up.
    (Note, yes, our assignment has that many integers for the...
  17. Replies
    4
    Views
    1,190

    Thanks a lot man. Got an error about the count,...

    Thanks a lot man. Got an error about the count, even, and odd not being declared or something, but I figured that out.

    Question, the data[i] is basically the directory for everything that was...
  18. Replies
    4
    Views
    1,190

    A few problems getting data from an array

    Hey guys, having a bit of trouble with more of this array stuff. This is my code so far:

    #include <stdio.h>
    #include <stdlib.h>

    int main(void)

    {
    int data[50];
    int i, n, start, stop;
  19. Replies
    3
    Views
    28,856

    lmao, wow I feel like an idiot. XD Thanks Feen.

    lmao, wow I feel like an idiot. XD Thanks Feen.
  20. Replies
    3
    Views
    28,856

    Printing an array in reverse order!

    I'm pretty new to arrays, and I'm having a slight problem printing one of my arrays in reverse:

    #include <stdio.h>

    int main(void)

    { int i;
    int firstarray[7] = {4, 9, -3, 0, 2, 7, 51};...
  21. Replies
    3
    Views
    1,753

    Damn, it really WAS simple. XD I basically had...

    Damn, it really WAS simple. XD I basically had the right ideas, just didnt work with the right loop functions. And here I thought I was good at FOR. XD
  22. Replies
    3
    Views
    1,753

    Absolutely stumped with running sum problem.

    I've been at this for hours, and cant seem to get a grasp on what I should use here. The problem is that I have to add the numbers from 100 counting down, to equal 5005. For example 100+99+98+97 and...
  23. Replies
    8
    Views
    3,236

    Hey thanks a lot guys! It works great! I see...

    Hey thanks a lot guys! It works great! I see where I made my mistakes. I was missing a simple ";"
  24. Replies
    8
    Views
    3,236

    Ok, I see where I didnt add in the extra...

    Ok, I see where I didnt add in the extra condition in my IF statement to get rid of the 0's. But I'm having problems with the program including 20 with the solutions.
    @Adak, I tried that and it...
  25. Replies
    8
    Views
    3,236

    "Inclusive" problem with my program.

    Hey guys, I wrote a program for our assignment, and I'm having only one problem with it. The program is supposed to ask for an integer, find integers divisible by 5 between 1 and the integer you...
Results 1 to 25 of 27
Page 1 of 2 1 2