M

@mattar

test address 3

C
2 years ago
#include <stdio.h> void main() { int x = 1, y = 2, *ip; ip = &x; y = *ip; *ip = 3; printf("x = %d, y = %d", x, y); }

test address 2

C
2 years ago
#include <stdio.h> void main() { float *pu, nu; float u = 1234.0; pu = &u; nu = *pu; printf("Alamat dari u = %p\n", &u);

test address

C
2 years ago
#include <stdio.h> void main() { int z = 20, s = 30, *pz, *ps; pz = &z; ps = &s; *pz += *ps; printf("z = %d\n", z);

Desimal ke biner

C
2 years ago
#include <stdio.h> void main() { int decimal; scanf("%d", &decimal); if (decimal <= 255) { int result[] = {2, 2, 2, 2, 2, 2, 2, 2}; int i = 0;

Binary ke desimal

C
2 years ago
#include <stdio.h> void main() { int digits; scanf("%d", &digits); if (digits < 9) { int result = 0; digits -= 1;

Pemecah Angka

C
2 years ago
#include <stdio.h> void main() { int num; scanf("%d", &num); if (num < 10000) { int temp = num; int i = 0;

3. sin cos tan

C
2 years ago
#include <stdio.h> #include <math.h> float radian(int degrees); void main() { int x[] = {0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330, 360}; float data[3][13] = {{}, {}, {}}; for (int i = 0; i < 3; i++) {

2. find average value

C
2 years ago
#include <stdio.h> void main() { int data[4][3] = { {81, 90, 62}, {50, 83, 87}, {89, 55, 65}, {77, 70, 92}, };

1. find max in numbers

C
2 years ago
#include <stdio.h> void input(int *arr, int length); int findmax(int arr[], int length); void main() { int length; printf("Berapa banyak data yang ingin di masukkan? "); scanf("%d", &length);

4. find max number of array

C
2 years ago
#include <stdio.h> void main() { int n, max = 0; printf("Berapa banyak data yang ingin di masukkan? \n"); scanf("%d", &n); int number[n];

3. matrik

C
2 years ago
#include <stdio.h> void main() { int n; printf("Masukkan ordo matrik: "); scanf("%d", &n); int matrixA[n][n], matrixB[n][n], matrixC[n][n]; char typeMatrix = 'A';

2. fibonanci

C
2 years ago
#include <stdio.h> void main() { int n; printf("Masukkan bilangan maks: "); scanf("%d", &n); int fibonanci[n];

1. print each element array

C
2 years ago
#include <stdio.h> void main() { int numbers[] = {2, 5, 3, 2, 6, 8, 4, 9, 10, 8}; for (int i = 0; i < 10; i++) { printf("Array index ke %d adalah %d\n", i, numbers[i]); } }

2. length unit converter

C
2 years ago
#include <stdio.h> float f_to_i(float ft); float i_to_cm(float in); float c_to_m(float cm); void main() { float input; printf("Masukkan panjang dalam satuan kaki (feet): ");

1. trilogy function

C
2 years ago
#include <stdio.h> int masukan(int n); int average(int total, int n); void main() { int n; printf("Masukkan jumlah data: "); scanf("%d", &n);

4. pythagoras

C
2 years ago
#include <stdio.h> #include <math.h> double lookingForSide(double degrees, double side); void main() { double degrees = 5, side = 2; printf("ABC %.2lf, AB %.2lf. result is a %.2lf", degrees, side, lookingForSide(degrees, side)); }

2. combination and permutation

C
2 years ago
#include <stdio.h> long factorial(int value); int combination(int n, int r); int permutation(int n, int r); void main() { int resultOfCombination = combination(5, 2); int resultOfPermutation = permutation(5, 2);

3. increment by two

C
2 years ago
#include <stdio.h> void incrementByTwo(int *value1, int *value2); void main() { int value1 = 5, value2 = 2; printf("the result of %d and %d is", value1, value2); incrementByTwo(&value1, &value2); printf(" %d and %d", value1, v

1. compare

C
2 years ago
#include <stdio.h> int compare(int value1, int value2); void main() { int result = compare(5, 2); printf("5 vs 2, the winner is %d", result); }