The variable is being used without initialize
Résolu
jomulex
-
jomulex Messages postés 7 Date d'inscription Statut Membre Dernière intervention -
jomulex Messages postés 7 Date d'inscription Statut Membre Dernière intervention -
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
- Vba range avec variable ✓ - Forum VB / VBA
- The system has detected that a cooling fan is not operating correctly - Forum Matériel & Système