Search:

Type: Posts; User: me77

Page 1 of 2 1 2

Search: Search took 0.01 seconds.

  1. Replies
    5
    Views
    4,233

    random number within user entered range

    Code so far:



    #include <iostream>
    #include <cstdlib>
    using namespace std;

    int main(void){
  2. Thread: array math

    by me77
    Replies
    4
    Views
    2,975

    How would I make them numeric values... an array...

    How would I make them numeric values... an array can't really be an "int" right?

    So I tried:

    int val2, val2;
    val1 = ar[0][0];
    val2 =ar[0][1];

    but when i display their contents after...
  3. Thread: array math

    by me77
    Replies
    4
    Views
    2,975

    array math

    Hey,

    Here is my code:



    #include <iostream>
    using namespace std;

    int main(void){
  4. Replies
    2
    Views
    1,406

    ah yes, you're right its actually 57. so there's...

    ah yes, you're right its actually 57. so there's no way of just normally adding or subtracting array values?
  5. Replies
    2
    Views
    1,406

    array multiplication odd output

    So I have an array : isbn[20][20]

    and then i input : 978-0-306-4061

    then i try to multiply the first character, 9, by one :

    s = isbn[0][0] * 1;

    and instead of 9 i get.. 56.. i don't get...
  6. Thread: caesar cypher

    by me77
    Replies
    17
    Views
    3,744

    Alright thanks :D

    Alright thanks :D
  7. Thread: caesar cypher

    by me77
    Replies
    17
    Views
    3,744

    You were right it was the new line :-). I've...

    You were right it was the new line :-). I've fixed it and it works perfectly now.. thanks for all the help !

    Let me know if I could've done this in a better way:


    for(i=0;sent[i];i++){
    ...
  8. Thread: caesar cypher

    by me77
    Replies
    17
    Views
    3,744

    Problem solved. I converted the character a to...

    Problem solved. I converted the character a to int and now it works great....


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


    int main(void){

    int i,a;
  9. Thread: caesar cypher

    by me77
    Replies
    17
    Views
    3,744

    Aha, it converts 'a' into its ascii format. Lets...

    Aha, it converts 'a' into its ascii format. Lets see if I can fix this..

    BTW, I don't understand what the gar = getchar() is for
  10. Thread: caesar cypher

    by me77
    Replies
    17
    Views
    3,744

    I don't know if this is what you meant, but now...

    I don't know if this is what you meant, but now the 0 terminates the program and the encoding the number has been fixed, but the actual interpreting of the sentence has totally screwed up. I'm...
  11. Thread: caesar cypher

    by me77
    Replies
    17
    Views
    3,744

    But for the problem the input must be: first...

    But for the problem the input must be: first line- the number to increment and the second line the sentence. So I don't see how the number could also be in the sent array.
  12. Thread: caesar cypher

    by me77
    Replies
    17
    Views
    3,744

    Ok. So I added this: ...

    Ok. So I added this:


    while(scanf("%d",&a) && a != 0){

    Like always, It still encodes the number itself which I don't get how to stop because it should ask for the next input.

    For...
  13. Thread: caesar cypher

    by me77
    Replies
    17
    Views
    3,744

    Thanks for your replys. I've updated the program...

    Thanks for your replys. I've updated the program and now have partial success.


    int main(void){

    int i=0,a;
    char sent[100];
    while(scanf("%d",&a) != '0'){

    ...
  14. Thread: caesar cypher

    by me77
    Replies
    17
    Views
    3,744

    caesar cypher

    I'm trying to create a program that first takes in a number that determines the amount of letters the second input (sentence) will go up. This is what I have so far:


    #include <stdio.h>
    #include...
  15. Thread: loop problem

    by me77
    Replies
    2
    Views
    892

    oh that makes sense getchar lol thanks.

    oh that makes sense getchar lol thanks.
  16. Thread: loop problem

    by me77
    Replies
    2
    Views
    892

    loop problem

    I don't even know if i did the rest of this right, but the first loop that looks for 0 doesn't even work and i don't know why.

    It's supposed to first accept an integer n that will be used to...
  17. Replies
    2
    Views
    1,199

    oh wow such a small mistake to me forever .....

    oh wow such a small mistake to me forever .. thanks a lot now works



    int main(void)
    {
    int nums[3][5];
    int i,j;

    printf("Enter 3 sets of 5 double numbers: ");
  18. Replies
    2
    Views
    1,199

    Writing to multi-d array.

    I'm new to multidimensional arrays and I just don't understand how to write into them.. help?





    int main(void)
    {
    int nums[3][5];
    int i,j;
  19. Thread: recursion

    by me77
    Replies
    3
    Views
    969

    ok so 0 and 1 i get.. it prints out either 0 or...

    ok so 0 and 1 i get.. it prints out either 0 or 01

    now lets take 2 for example.. r = 0
    2 is = to 2 so 2 / 2 is 1
    now r =1 r is < 2 so it prints 01

    but thats wrong. how am i looking at this...
  20. Thread: recursion

    by me77
    Replies
    3
    Views
    969

    recursion

    I was hoping someone could please walk me through on how this works.




    /* Code that accepts a user number and puts it into a function to_binary */

    void to_binary(int n)
    {
    int r;
  21. Thread: doesnt upload???

    by me77
    Replies
    1
    Views
    1,111

    doesnt upload???

    #include <stdio.h>
    #include <wininet.h>
    #include <windows.h>
    void asdf(void);

    int main(void)
    {
    asdf();
    return 0;
    }
  22. Thread: why not work?

    by me77
    Replies
    3
    Views
    1,049

    for some reason i was thinking that while it was...

    for some reason i was thinking that while it was falso it would keep on going lol.. dont know why.. but i fixed it by changing the values of da and de of what they would be after one day. thanks
  23. Thread: why not work?

    by me77
    Replies
    3
    Views
    1,049

    er hahahah dur.. lol

    er hahahah dur.. lol
  24. Thread: why not work?

    by me77
    Replies
    3
    Views
    1,049

    why not work?

    I'm so stumped on why this doesn't work. It displays:

    It took 1 days for Deirdre to make more then Daphne. Daphne has $100.00 and Deidre has $100.00.

    But shouldn't because 100.0 is not > then...
  25. Thread: another method?

    by me77
    Replies
    4
    Views
    1,225

    oh lol i didnt even notice the changes.. lets try...

    oh lol i didnt even notice the changes.. lets try it out

    ah ic now.. thanks for the help NeonBlack :)
Results 1 to 25 of 39
Page 1 of 2 1 2