Hello all,
As you may see, I am new to this forum.
I started programming a little while ago, I'm not that good yet, still can't understand pointers, or insert pictures, but I do exercise by making loads of programs.
I am trying to make a program that will find me all the dividers of a certain number.
I get an error message saying "Error: too few arguments to function "etape1""
Can anyone please find my error?
Here is my source code:
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
// Trouve TOUT les diviseurs d'un nombre.
int etape1(int divise, int nombreEntre, int resultat)
{
do
{
if (nombreEntre%divise == 0);
{
printf("%d\n", divise);
}
divise++;
} while (divise < nombreEntre);
return 0;
}
int main(int argc, char *argv[])
{
int nombreEntre = 0, resultat = 0;
printf("Entrez un nombre pour voir tout ses diviseurs\n ");
scanf("%d", &nombreEntre);
resultat = etape1(nombreEntre); Edit: This is where the error is.
return 0;
}
Thanks a lot, Jonathan Poll