Skip to content

Instantly share code, notes, and snippets.

@achmadweb
Created September 17, 2020 10:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save achmadweb/58be4b509e833cfdfcb6dea42946da75 to your computer and use it in GitHub Desktop.
Save achmadweb/58be4b509e833cfdfcb6dea42946da75 to your computer and use it in GitHub Desktop.
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() {
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