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>...
Type: Posts; User: holler
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>...
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...
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...
Would call that a solution..
struct office
{
char name[32];
int desk;
};
struct office worker[3];
int i;
Hi,
Could you help me to figure out what is wrong with this chunk of code?
int i,j;
struct office
{
char name;
Thanks. Now it works.
double calculator(char op, double in1, double in2);
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...
I see. Replaced goto with continue and getch() with getchar().
do
{
printf("\nChoose a number: \n");
scanf("%d",&choice);
if(choice != 1 && choice != 2 &&...
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};
...
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...
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");
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...