Skip to content

Instantly share code, notes, and snippets.

View achmadweb's full-sized avatar
🎯
Focusing

Achmad Hidayat achmadweb

🎯
Focusing
View GitHub Profile
@achmadweb
achmadweb / proc.c
Created September 17, 2020 12:42
Contoh program utama dan prosedur untuk menukar 2 buah nilai
#include<stdio.h>
void plus1 (int* a) {
int temp;
*a=*a+1;
}
void plusd (int* a, int d) {
@achmadweb
achmadweb / fadd.c
Created September 17, 2020 10:37
Fungsi yang menjumlahkan a+b
#include <stdio.h>
int add (int a, int b) {
return(a+b);
}
int inkremen (int a) {
return (a+1);
}
int main() {
@achmadweb
achmadweb / maxsort.c
Created September 17, 2020 09:25
Maximum
#include<stdio.h>
int main()
{
int i;
int Tab[10]= {1, 50, 6, 200, 3, 100, 30, 8, 99, 100 };
int max;
int k, temp;
@achmadweb
achmadweb / max.c
Created September 17, 2020 07:02
Maximum-Minimum
#include<stdio.h>
int main()
{
int i;
int Tab[10]={ 1, 50, 6, 200, 3, 300, 100, 30, 8, 99 };
int max;
max = Tab[0];
for (i=1;i<10; i++){
@achmadweb
achmadweb / tabel1.c
Created September 17, 2020 06:55
Baca Tulis Isi Tabel
#include<stdio.h>
int main()
{
int Tab [5];
int i;
for (i=0; i<5; i++);{
scanf ("%d", &Tab[i]);
@achmadweb
achmadweb / IF_ELSE_IF.c
Created September 16, 2020 09:06
Instruksi If else if
#include<stdio.h>
int main()
{
int a;
printf ("Contoh IF tiga kasus \n");
printf ("Ketikkan suatu nilai integer : ");
scanf ("%d", &a);
@achmadweb
achmadweb / Boolean
Created September 16, 2020 08:47
Operator Boolean
#include<stdio.h>
int main()
{
int TRUE = 1;
int FALSE = 0;
printf ("Ini nilai true and true : %d \n", TRUE && TRUE );
printf ("Ini nilai true or false : %d \n", TRUE || FALSE );
printf ("Ini nilai false and true : %d \n", FALSE && TRUE );
@achmadweb
achmadweb / aritmetika
Created September 16, 2020 08:30
OPERASI ARITMETIKA
#include<stdio.h>
int main()
{
int x=5;
int y=8;
printf ("Ini nilai x + y :%d \n", x+y);
printf ("Ini nilai x - y : %d \n", x-y);
printf ("Ini nilai x * y : %d \n", x*y);