This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NURIAN S WARDANA | |
// Membalik isi array dengan temporary variable | |
#include <stdio.h> | |
int main() { | |
char array[] = {'a','b','c','d','e','f','g','h','i','j',}; | |
int arrayLength = sizeof(array) / sizeof(char); | |
int lastIndex = arrayLength - 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NURIAN S WARDANA | |
// Membalik isi array dengan temporary array | |
#include <stdio.h> | |
int main() { | |
char array[] = {'a','b','c','d','e','f','g','h','i','j',}; | |
int arrayLength = sizeof(array) / sizeof(char); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NURIAN S WARDANA | |
// Menampilkan isi array | |
#include <stdio.h> | |
int main() { | |
// deklarasi array | |
char array[] = {'a','b','c','d','e','f','g','h','i','j',}; | |
// supaya bisa hitung panjang array |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NURIAN S WARDANA | |
#include <stdio.h> | |
void printHeader() { | |
printf("===================================\n"); | |
printf("| KALKULATOR FAKTORIAL |\n"); | |
printf("===================================\n"); | |
printf("| Panduan |\n"); | |
printf("| 1. Masukkan angka pertama |\n"); | |
printf("| sebagai bilangan yang |\n"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NURIAN S WARDANA | |
#include <stdio.h> | |
int factorial(int number) { | |
if (number <= 1) { | |
return 1; | |
} else { | |
return number * factorial(number - 1); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [output] = rarxls(data, orde, ff) | |
% Menentukan initial value dari covariance matrix P | |
alpha = 100; | |
% Mendapat ukuran data | |
[sizeRow, sizeColumn] = size(data); | |
if sizeColumn ~= 2, error('y dan u masing-masing harus terdiri dari satu kolom'); end | |
N = sizeRow; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [flag] = pdtest(P) | |
% Mencari nilai N, yaitu besarnya matrix P | |
% Matrix P harus merupakan rectangular matrix | |
[row, column] = size(P); | |
if row ~= column | |
error('Matrix harus rectangular'); | |
end | |
N = row; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [output] = excitat(u) | |
% Mencari nilai N, yaitu banyaknya data input u | |
[row, column] = size(u); | |
if row > column, N = row; | |
else, N = column; | |
end | |
% Membuat tabel Rn, lalu mengisinya dengan Ruu(tau) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function [output] = proyek(string) | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% SISTEM DISKRIT %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
string = strrep(string, 'n', 't'); | |
string = strrep(string, '[', '('); | |
string = strrep(string, ']', ')'); | |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% UJI LINEARITY %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% | |
syms t; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <string.h> | |
// FUNGSI UNTUK MENCARI NILAI MAKSIMUM DARI BEBERAPA DATA // | |
int max(int a, int b, int c, int d, int e) { | |
int ab = (a >= b ? a : b); | |
int cd = (c >= d ? c : d); | |
int abcd = (ab >= cd ? ab : cd); | |
int abcde = (abcd >= e ? abcd : e); | |
return abcde; |