The variable is being used without initialize
Résolu
jomulex
-
jomulex Messages postés 7 Statut Membre -
jomulex Messages postés 7 Statut Membre -
Bonjour,
J'ai probleme avec mon code. Je ne comprends pas ou est l'erreur.
Le voici, aidez moi svp, pcq je recois un message du genre
''the variable total is being used without being initialized''
/*Par moi
Date : 21/09/2011
*/
#include <stdio.h>
#include <stdlib.h>
/*FACTORIEL
cette fonction retourne le factoriel d'un nombre.
nb: valeur d'entree (type entier)
*/
double FACTORIEL(double nb);
int main(void)
{
printf("%f\n", FACTORIEL(5));
return 0;
}
double FACTORIEL(double nb)
{
int j;
double total;
for (j = 2; j <= nb; j++)
{
total = (total * j;
}
return total;
}
J'ai probleme avec mon code. Je ne comprends pas ou est l'erreur.
Le voici, aidez moi svp, pcq je recois un message du genre
''the variable total is being used without being initialized''
/*Par moi
Date : 21/09/2011
*/
#include <stdio.h>
#include <stdlib.h>
/*FACTORIEL
cette fonction retourne le factoriel d'un nombre.
nb: valeur d'entree (type entier)
*/
double FACTORIEL(double nb);
int main(void)
{
printf("%f\n", FACTORIEL(5));
return 0;
}
double FACTORIEL(double nb)
{
int j;
double total;
for (j = 2; j <= nb; j++)
{
total = (total * j;
}
return total;
}
A voir également:
- The variable is being used without initialize
- What is my movie français - Télécharger - Divers TV & Vidéo
- Who is on my wifi - Télécharger - Outils Internet
- Your messenger verification code is ✓ - Forum Facebook Messenger
- Vba range avec variable ✓ - Forum VB / VBA
- The media could not be loaded, either because the server or network failed or because the format is not supported. ✓ - Forum Mozilla Firefox