|
/******* Mon joli programme ********/ /* Déclaration des variables */ int a; void main() { a = 1; /* Une autre affectation... */ a = 3; } |
|
int i = 17; float x; char c = '@'; int test = 1 ; float tab[10]; |
|
{ int a; scanf("%d",&a); printf("A+1 vaut %d\n", a+1); } |
|
if(((x == .5) && (i % 2 == 1)) || (x/i < 3)) { printf("x vaut 1/2\n"); } if(i >= 0) { a = i+1; b = a*a; } else { a = i-1; b = a*a*a; } |
|
for (i = 0; i < N; i++) { Toto(i); } |
|
for (i = 1; i <= 100; i=i+5) { Toto(i); } |
|
for (i = 23; i >=12; i--) { Toto(i); } |
|
{ int i,n,acc; acc = 0; scanf("%d",&n); for(i = 0; i <= n; i++) { acc = acc + i*i*i ; } printf("Somme cubes de 1 à %d : %d\n",n,acc); } |
|
int pas_premier(int n) { int j = 2; while((j < n) && (n % j != 0)) { j++; } if(j == n) { return 1; } else { return 0; } } |