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
- Where is it - Télécharger - Gestion de fichiers
- The realtek network controller was not found. if deep sleep mode is enabled please plug the cable ✓ - Forum Pilotes (drivers)
- The system has detected that a cooling fan is not operating correctly - Forum Matériel & Système