Created
September 17, 2020 10:37
-
-
Save achmadweb/58be4b509e833cfdfcb6dea42946da75 to your computer and use it in GitHub Desktop.
Fungsi yang menjumlahkan a+b
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() { | |
int x=10; | |
int y=25; | |
printf("Hasil penjumlahan x+y =%d\n", add(x,y)); | |
printf("Hasil penjumlahan 3+2 =%d\n", add (3,2)); | |
printf("Nilai x : %d\n", x); | |
printf("Nilai x setelah ditambah 1 : %d\n ", inkremen(x)); | |
printf("Nilai 5 setelah ditambah 1 : %d\n ", inkremen (5)); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment