mirror of
https://codeberg.org/DansLeRuSH/c-plus-plus-exercises.git
synced 2024-11-23 19:58:09 +00:00
Averaging two numbers
This commit is contained in:
parent
849ee8151a
commit
6b780fbedc
1 changed files with 14 additions and 0 deletions
14
EX03_moyenne_2_nombres.cpp
Normal file
14
EX03_moyenne_2_nombres.cpp
Normal file
|
@ -0,0 +1,14 @@
|
|||
// Auteur : Franck ALBARET
|
||||
#include <stdio.h>
|
||||
|
||||
int main (void)
|
||||
{
|
||||
int Nbr;
|
||||
int Nbr2;
|
||||
puts ("Quel est le premier nombre ?");
|
||||
scanf ("%i",&Nbr);
|
||||
puts ("Quel est le deuxième nombre ?");
|
||||
scanf ("%i",&Nbr2);
|
||||
printf("La moyenne est %i\n",(Nbr+Nbr2)/2);
|
||||
return 0;
|
||||
}
|
Loading…
Reference in a new issue