no save
Assistance
Achat
News

Forum | programmation
[langage C] comment remplacer[for] par [if]
Char Snipeur, le lun. 04 sept. 2006 à 14:40:09
en effet, j'y avai penser, sans savoir comment faire exactement.
void dipt(int& num)
{
if((num%2==0)&(num%3==0))
printf("%d est divisible par deux et trois\n",num);
else
{scanf("%d",num);dipt(num);}
}
int main()
{
int num=1;
scanf("%d",num);
dipt(num);
return 0;
}

Précédentlami20j
sept. 06
mamiemando
sept. 06
Suivant
REPONSES
jamel_theone
sept. 06
mamiemando
sept. 06
novice
sept. 06
Char Snipeur
sept. 06
mamiemando
sept. 06
Jeff
sept. 06
novice
sept. 06
lami20j
sept. 06
Char Snipeur
sept. 06
mamiemando
sept. 06
Version Web
Réalisé par RedShift
no save