mirror of
https://codeberg.org/DansLeRuSH/c-plus-plus-exercises.git
synced 2024-11-22 03:28:09 +00:00
Averaging two numbers
This commit is contained in:
parent
6dcbeb9cf1
commit
85ce74d976
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