Search:

Type: Posts; User: SimarGill

Search: Search took 0.01 seconds.

  1. Replies
    18
    Views
    2,114

    it ignores everything after the decimal because...

    it ignores everything after the decimal because you used %d in your scanf's. %d means to scan for a integer value which are whole numbers if you would like to scan in a decimal number, use double...
  2. Hey, sorry for the late reply. I did what you...

    Hey, sorry for the late reply. I did what you said like make all my counters reset to 0 and that worked like a charm. Only question I have now is that how can I make this while loop only run until...
  3. Clearing all elements in array and displaying the sum of numbers in an array!

    Hey, I have created this program that displays a menu and asks the user to select their option and program will do that option. I tried to make my code as easy to understand but if you need help...
  4. I can sleep now at night. Thank You.

    I can sleep now at night. Thank You.
  5. I do it, every single day....I just can't seem to...

    I do it, every single day....I just can't seem to save a user input into an arrays elements starting from index 0 instead I can only save it to a specific index. I have 4 other courses and I try to...
  6. Alright I did that but I still can't option D or...

    Alright I did that but I still can't option D or P to work. How can I save user inputs in a array?
  7. Struggling Very Much On This Array Program!!

    I am making a program that will make a menu as shown below and so far I am up to option P and can't seem to print out all the positive numbers in the array. And I can't also make it keep looping.

    ...
  8. When my user enters 'E' or 'e' then it asks them...

    When my user enters 'E' or 'e' then it asks them for their input as an integer but now the problem is which index in the array should I save it to knowing that my program will continually run.


    ...
  9. Yes, you are right and that is exactly what I...

    Yes, you are right and that is exactly what I can't figure out how to actually code the for loop. I am trying to use a for loop right now but can't seem to understand what to actually code it.


    ...
  10. Yes, I have two different arrays. One for...

    Yes, I have two different arrays. One for negative and one for positive numbers but if I want to display all the positive numbers the user entered, what would be the syntax. All my arrays are of [10]...
  11. Printing out previously entered user input!

    I am creating a program that will continually take in the user inputs and when they press 'q', it will show all the entered user inputs. Assuming that all the inputs are to be integers. What would be...
  12. Replies
    5
    Views
    1,219

    Yes I experimented and it works perfectly! But I...

    Yes I experimented and it works perfectly! But I am interested in to see how I can use the tolower function here to make every input to lower case and then proceed as usual.
  13. Replies
    5
    Views
    1,219

    So that means I would have to put a IF statement...

    So that means I would have to put a IF statement to check if the variable is uppercase and if it is then the switch statement should get executed assuming that im using toupper function.
  14. Replies
    5
    Views
    1,219

    Using switch-case statements!

    So I am trying to create a program that will take an integer from the user if they enter 'E' or 'e' from the menu. So my code looks like this:




    // Menu options: C, c, D, d, E, e and saves the...
  15. Yes, I have downloaded it from my compilers...

    Yes, I have downloaded it from my compilers website. And damn it, I spent $150 for that book. :(
  16. Ohh alright I got it. In my book, it just that...

    Ohh alright I got it. In my book, it just that says that scanf reads an input from stdin stream. The string pointed to by format specifies the format of the items to be read. But I understand now,...
  17. Replies
    9
    Views
    1,326

    Yes that's right but my teacher always said that...

    Yes that's right but my teacher always said that to start with c programming, always start from the very basics and do everything the hard way so you understand future concepts much easier after. So...
  18. Ah I got it now. Thanks but in that case, %c can...

    Ah I got it now. Thanks but in that case, %c can be %d or whatever since it will always be waiting for one sort of input. Or is this issue only with %c. I never had this before.
  19. Replies
    9
    Views
    1,326

    To put it back to capitals just subtract 32 from...

    To put it back to capitals just subtract 32 from the variable that contains the lower case letter. If you look up the ASCII table, you will see that subtracting 32 gives you the capital letter.
  20. LOL ok i got it now, so im basically telling...

    LOL ok i got it now, so im basically telling scanf to wait for 2 characters in the buffer since the enter key seems to skip it. Wow, that is a flaw.
  21. Thanks Adak, I just placed a space between " %...

    Thanks Adak, I just placed a space between " % and it worked perfectly. Still don't understand the whole '\n' and keyboard buffer concept. But I appreciate your help. Thanks though and see you around.
  22. Compiler keeps skipping over the scanf statement!! Please Help.

    Hello, I am trying to code a basic program which takes 2 inputs from a user based on a menu and then converts the second input to the menu choice chosen. For example, if 'a' is chosen and the number...
Results 1 to 22 of 22