mirror of
https://codeberg.org/DansLeRuSH/c-plus-plus-exercises.git
synced 2024-11-21 11:18:07 +00:00
Even or odd number ?
This commit is contained in:
parent
6e3fc41ca1
commit
56e36351c6
1 changed files with 15 additions and 0 deletions
15
EXO-05_nombre_pair_ou_impair.cpp
Normal file
15
EXO-05_nombre_pair_ou_impair.cpp
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
// Auteur : Franck ALBARET
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
|
int main (void)
|
||||||
|
{
|
||||||
|
int Nbr,Reste;
|
||||||
|
puts ("Veuillez taper un entier :");
|
||||||
|
scanf ("%i",&Nbr);
|
||||||
|
Reste=Nbr%2;
|
||||||
|
if (Reste==0)
|
||||||
|
puts ("Le nombre est pair\n");
|
||||||
|
else
|
||||||
|
puts ("Le nombre est impair\n");
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in a new issue