0

beginner C programming

Hello everybody can you help me this exercise here is what the professor ask us to do : EXERCISE 1: Write a program that asks the user to enter a series of 10 integer Values, the program determines and displays the biggest and smallest of the serie. here is what i've done #include<stdio.h> main() { int i, n, max,min; printf ("Saisir la premiere valeur entiere. \n"); scanf ("%d", &n); max = n; min=n; for (i=0; i<9 ; i++) { printf ("\n Entrer une autre valeur entiere. \n"); scanf ("%d",&n); if (n>max) max=n; if (n<min) min=n; } printf (" Le plus grand nombre de la serie est : %d", max); printf (" Le plus petit nombre de la serie est %d", min); } is it correct or no ?

21st Mar 2017, 8:34 PM
akane96
2 Réponses
0
i think its true
21st Mar 2017, 8:44 PM
saeed
saeed - avatar
0
Yes
21st Mar 2017, 9:20 PM
Dextozz
Dextozz - avatar