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> | |
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); |
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> | |
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 ); |
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> | |
int main() | |
{ | |
int a; | |
printf ("Contoh IF tiga kasus \n"); | |
printf ("Ketikkan suatu nilai integer : "); | |
scanf ("%d", &a); |
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> | |
int main() | |
{ | |
int Tab [5]; | |
int i; | |
for (i=0; i<5; i++);{ | |
scanf ("%d", &Tab[i]); |
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> | |
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++){ |
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> | |
int main() | |
{ | |
int i; | |
int Tab[10]= {1, 50, 6, 200, 3, 100, 30, 8, 99, 100 }; | |
int max; | |
int k, temp; | |
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> | |
int add (int a, int b) { | |
return(a+b); | |
} | |
int inkremen (int a) { | |
return (a+1); | |
} | |
int main() { |
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> | |
void plus1 (int* a) { | |
int temp; | |
*a=*a+1; | |
} | |
void plusd (int* a, int d) { | |