Skip to content

Instantly share code, notes, and snippets.

View paley777's full-sized avatar
🎯
Focusing

Valleryan Virgil Zuliuskandar paley777

🎯
Focusing
View GitHub Profile
@paley777
paley777 / gajikaryawan.kt
Created June 18, 2022 07:58
Conditions with Kotlin
fun main(args: Array<String>){
var gaji: Int = 0
var hadir1: Int = 0
var ksgaji: Int = 0
var pajak: Int = 0
var gajiakhir: Int = 0
println("PROGRAM GAJI KARYAWAN")
println("==============================")
println("Kode Bagian :")
println("[1] Programmer")
@paley777
paley777 / arithmetic.cpp
Created June 18, 2022 08:11
C++ arithmetic operations
# include <iostream>
using namespace std;
int main() {
char op;
float num1, num2;
cout << "Enter operator: +, -, *, /: ";
cin >> op;
@paley777
paley777 / arithmetic1.cpp
Created June 18, 2022 08:13
C++ mixed arithmetic operations
#include <iostream>
using namespace std;
int main()
{
float a,b,c,d,e,f;
cout<<"Masukan Nilai A: ";
cin>>a;
cout<<"Masukan Nilai B: ";
@paley777
paley777 / indec.cpp
Created June 18, 2022 08:15
Increment and Decrement C++
#include <iostream>
#include <conio.h>
using namespace std;
int main(){
int a=8,b=4,x=8,y=4;
printf("\n Nilai A = %d",a);
printf("\n Nilai ++A = %d",++a);
printf("\n Nilai A = %d",a);
printf("\n Nilai B = %d",b);
@paley777
paley777 / compare.cpp
Created June 18, 2022 08:16
Number Comparison C++
#include <iostream>
#include <conio.h>
using namespace std;
int mainp(){
int m=15, n=7;
if(m>n) cout<<m<<" Lebih besar dari "<<n<<endl;
else if (m<n) cout<<m<<" Lebih Kecil dari "<<n<<endl;
if(m=n) cout<<m<<" Sama dengan "<<n<<endl;
@paley777
paley777 / circle.cpp
Created June 18, 2022 08:17
Area of Circle C++
#include <iostream>
using namespace std;
int main() {
float phi = 3.14;
float r = 7;
float L = phi * r * r;
cout << "Luasnya lingkaran dengan jari-jari " << r << " adalah " << L ;
return 0;
@paley777
paley777 / triangle.cpp
Created June 18, 2022 08:17
Area of Triangle C++
#include <iostream>
using namespace std;
int main()
{
float Alas, Tinggi, Luas_Segitiga;
cout<<"Masukkan Nilai Alas Segitiga: ";
cin>>Alas;
cout<<"Masukkan Nilai Tinggi Segitiga: ";
@paley777
paley777 / ifelse.cpp
Created June 18, 2022 08:18
If-Else C++
#include <iostream>
using namespace std;
int main(){
int x, y;
std::cout << "Masukan sebuah bilangan bulat : ";
std::cin >> x;
std::cout << "Masukan sebuah bilangan lain : ";
std::cin >> y;
@paley777
paley777 / switchcase.cpp
Created June 18, 2022 08:19
Switch Case C++
#include <iostream>
using namespace std;
int main(){
char nilai;
cout << "Please insert a grade (A, B, C, D or E): ";
cin >> nilai;
switch(nilai)
@paley777
paley777 / loop.cpp
Created June 18, 2022 08:20
Looping C++
#include <iostream>
using namespace std;
int main()
{
int angka = 0;
// perulangan for
cout << "Perulangan menggunakan for: " << endl;