samedi 15 août 2020

(C) I'm trying to select a random variable in C, but I don't know how. Is there a way that I could do this?

Additional information: I am trying to print a motivational quote using a token system which will be subtracted by 1 for every token used. If I didn't make it clear in the title, I want one variable containing the motivational quote to be printed, and I want a different motivational quote to be printed each time the program is run. Keep in mind this program is unfinished. Here is my code below:

#include <stdio.h>
int main () {
int token;
int tokenCount = 5;

printf ("You have %d tokens left\n\n", tokenCount);

printf ("Please enter a token: ");

scanf ("%d", token);

if (token == 1) {

}



Aucun commentaire:

Enregistrer un commentaire