Exemple #1
0
int main()
{
	printf("\n\n\nretfl: %f\n", retfl((float)pi));	
	printf("retdbl: %f\n", retdbl(pi));	
	printf("fl2dbl: %f\n", fl2dbl((float)pi));	

	printf("\nobvod: %f\n", obvod(5, M_PI));
	printf("fl2i: %d, %d, %d\n", fl2i(3.14), fl2i(3.5), fl2i(3.51));
	float floatnums[] = {1.1, 2.2, 3.9, -2, 1, 9, 10, 88, 9, 10, -6, 12};

	printf("\navg: %f\n", prumer(floatnums, sizeof(floatnums)/sizeof(*floatnums)));
	printf("\nmax: %f\n", max(floatnums, sizeof(floatnums)/sizeof(*floatnums)));
	printf("\narrsum: %f\n", arrsum(floatnums, sizeof(floatnums)/sizeof(*floatnums)));

	printf("\n--------------------------------\n");

	printf("\nvsphere: %f\n", vsphere(5, M_PI));
	printf("pytha(3, 4): %f\n", pytha(3.0, 4.0));
	double veca[] = {3.0, 1.0, 5.0};
	double vecb[] = {2.0, -2.0, 1.0};
	int veclen = 3;

	vecsum(veca, vecb, veclen);
	printf("vecsum:  ");
	for(int i=0; i<veclen; i++)
		printf("%f   ", veca[i]);
	printf("\nvecsize: %f\n", vecsize(veca, veclen));


}
Exemple #2
0
int main(void){
	int a[3]={3,33,333},b[3];
	arrcopy(a,b,3);
	printf("%d,%d,%d\n",b[1],b[2],b[3]);
	int o=arrsum(a,3);
	printf("%d\n",o);
	return 0;
}
Exemple #3
0
void main(int n) {
    int arr[100];
    squares(n, arr);
    int x;
    int *sum;
    sum = &x;
    *sum = 0;
    arrsum(n, arr, sum);
}
void main(int n) {
	int arr[20];
	
	squares(n, arr);
	
	int sum;
	arrsum(n, arr, &sum);
	
	print sum;
	println;
}
Exemple #5
0
void main(){
	int arr[4];
	arr[0] = 7;
	arr[1] = 13;
	arr[2] = 9;
	arr[3] = 8;
	int *sum;

	arrsum(4, arr,sum);
	print *sum;
	println;
}
Exemple #6
0
void main() {
	int* arr[4];
	arr[0] = 7;
	arr[1] = 13;
	arr[2] = 9;
	arr[3] = 8;
	int sump;	
	sump = 0;
	arrsum(4, arr, &sump);
	print(sump);
	println;
}