Search:

Type: Posts; User: holler

Search: Search took 0.00 seconds.

  1. Replies
    4
    Views
    1,934

    Hello, it's been a long time. Taking into...

    Hello, it's been a long time. Taking into consideration your suggestions I came up with the following code:



    # include <stdio.h>
    # include <stdlib.h>
    # include <time.h>
    # include <stdbool.h>...
  2. Replies
    4
    Views
    1,934

    Help to improve a simple Lotto game code

    Hello,
    Here are the steps I followed:
    1. Generate Lotto numbers 1 - 20.
    2. User makes a bet.
    3. Swap Lotto numbers (swap left-right).
    4. Computer picks (3) random numbers from Lotto and stores...
  3. Replies
    7
    Views
    1,760

    Yes. When I would run my first program, it was...

    Yes. When I would run my first program, it was crushing after the first input from scanf(). Finally solved it by replacing a char name with char name[NUM].

    I thought that fgets() is used to read...
  4. Replies
    7
    Views
    1,760

    Would call that a solution.. struct...

    Would call that a solution..


    struct office
    {
    char name[32];
    int desk;
    };
    struct office worker[3];
    int i;
  5. Replies
    7
    Views
    1,760

    Problems with struct members and for loop

    Hi,
    Could you help me to figure out what is wrong with this chunk of code?



    int i,j;

    struct office
    {
    char name;
  6. Thread: scanf problem

    by holler
    Replies
    2
    Views
    2,017

    Thanks. Now it works. double calculator(char...

    Thanks. Now it works.

    double calculator(char op, double in1, double in2);
  7. Thread: scanf problem

    by holler
    Replies
    2
    Views
    2,017

    scanf problem

    Hello,
    When I select a 2 option in a menu it runs a simple calculator program where I suppose scanf() causes a problem with reading numbers I input. The second number isn't the one I input but it's...
  8. Replies
    9
    Views
    2,439

    I see. Replaced goto with continue and getch()...

    I see. Replaced goto with continue and getch() with getchar().


    do
    {
    printf("\nChoose a number: \n");
    scanf("%d",&choice);
    if(choice != 1 && choice != 2 &&...
  9. Replies
    9
    Views
    2,439

    Thank you! Sharing my latest progress. The...

    Thank you! Sharing my latest progress.
    The program executes while there are free numbers left and stops when the array is empty.


    int len,choice,i,j;
    int nums[5] = {1,2,3,4,5};


    ...
  10. Replies
    9
    Views
    2,439

    Thanks for this. Though I'm here to learn, with...

    Thanks for this. Though I'm here to learn, with the limited knowledge that I have, still can't implement your suggestion.
    So far, I was able to accomplish only this chunk of code:


    int...
  11. Replies
    9
    Views
    2,439

    Sure.. It only works when I enter numbers one by...

    Sure..
    It only works when I enter numbers one by one from 1-5.



    int choice,tries,i;
    int nums[5] = {1,2,3,4,5};


    printf("Available numbers:\n");
  12. Replies
    9
    Views
    2,439

    help with a simple program

    Hello guys,
    I'm kind of stuck here trying to do some homework...writing a simple program which
    1. displays numbers from 1-5.
    2. user picks a number (1-5).
    3. the programs displays the available...
Results 1 to 12 of 12