more than 1 vector rep

 #include <stdio.h>

typedef struct vector{

    int x;

    int y;

    int z;

    

}vctr;

int main() {

    // Write C code here

    vctr v[4];

    for (int i = 0 ; i<4 ; i++){

        printf("enter mag of x of vector %d : ", i+1);

        scanf("%d",&v[i].x);

        printf("enter mag of y of vector %d : ", i+1);

        scanf("%d",&v[i].y);

        printf("enter mag of z of vector %d : ", i+1);

        scanf("%d",&v[i].z);

    }

   

    for (int i = 0 ; i<4 ; i++){

    printf("your vector is = %dx + %dy + %dz\n",v[i].x ,v[i].y ,v[i].z);

    }

    

    return 0;

}

Comments

Popular posts from this blog

Sum of Even Numbers till N

Find the Runner-Up Score!

Print All Substrings