Skip to content
Snippets Groups Projects
Commit 38634207 authored by Jakub Walas's avatar Jakub Walas
Browse files

Upload New File

parent d2e01274
Branches
No related merge requests found
#include <stdio.h>
#include <math.h>
int main(){
float m,v[3],p[3],b,c;
int i;
char d='x';
printf("Podaj mase\n");
scanf("%f",&m);
for (i=0;i<=2;i++) {
printf("Podaj %c skladowa\n",d+i);
scanf("%f",&b);
v[i]=b;
}
c=0;
for (i=0;i<=2;i++) {
v[i]=v[i]*m;
printf("Skladowa %c wynosi %.1f\n",d+i,v[i]);
c=c+v[i]*v[i];
}
c=sqrt(c);
printf("Wartosc tego wektora wynosi %.1f\n",c);
}
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