Skip to content
Snippets Groups Projects
Commit c2c5e831 authored by ATMITIM YAHYA's avatar ATMITIM YAHYA
Browse files

exercice 6

parent cbd0854f
Branches
No related merge requests found
#include <stdlib.h>
#include <stdio.h>
#define N 10
int main(){
int nb = rand();
......@@ -21,6 +22,13 @@ int main(){
}
printf("%d est le nombre mystere",p);
printf("%d est le nombre mystere \n",p);
// exercice 6
int somme = 0;
int tab[N]= {1,2,3,4,5,6,7,8,9,10};
for(int i = 0; i < N; i++){
somme += tab[i];
}
printf("la somme des elements du tableau est : %d", somme);
return 0;
}
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment