SommeVecVecSEQ.c
#include <stdio.h>
void main (void)
{
    int i,A[10],B[10],C[10];
 
    for(i=1;i<=10;i++)
    {
        A[i-1] = i;
        B[i-1] = 10 - i;
    }
 
    printf ("Les deux vecteurs :\n");
 
    printf ("A = ");
    for(i=1;i<=10;i++)
    {
        printf (" %d ", A[i-1]);
    }
 
    printf ("\nB = ");
    for(i=1;i<=10;i++)
    {
        printf (" %d ",B[i-1]);
    }
 
    for(i=1;i<=10;i++)
    {
       C[i-1]=A[i-1]+B[i-1];
    }
 
    printf ("\nLe vecteur somme : \n");
    printf ("C = ");
    for(i=1;i<=10;i++)
    {
        printf (" %d ",C[i-1]);
    }
    printf ("\n");
 
}
documentation/examples/sommevecvecseq.c.txt · Dernière modification: 2015/01/06 14:26 (modification externe)