samedi 15 octobre 2016

my srand code breaks down before it can run

PLEASE HELP

I've been trying to figure out what's wrong with my code but I can't for the life of me. I thought I had everything necessary and it will do some of the commands separately but not all together.

CODE:

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

int main(){
int owe, num = rand();

srand(time(0));
printf("%d", rand()% 4501 + 500);

printf("How much do you think you owe?\n");
scanf("%d", owe);

while(num > owe){
    printf("Yes, you owe more than %d dollars.\n", owe);
    printf("How much do you think you owe?\n");
    scanf("%d", owe);
}
while(num < owe){
    printf("No, you do not owe more than %d dollars.\n", owe);
    printf("How much do you think you owe?\n");
    scanf("%d", owe);
}
while(num == owe){
    printf("No, you do not owe more than %d dollars.\n", owe);
    printf("Congratulations for figuring out you owe %d dollars.\n", owe);
} 

return 0;
}




Aucun commentaire:

Enregistrer un commentaire