Input/Output Penjumlahan Dua Variabel
Nov 18, 2021
Add Comment
Fungsi input:
scanf("..",..);
Example:
scanf("%d", &x);
Fungsi output:
printf("..",..);
Example:
printf("%d", x);
Kedua fungsi tersebut terdapat di library:
#include <stdio.h>
Contoh source code:
#include <stdio.h>
int main()
{
int x;
int y;
printf("Masukkan nilai x: ");
scanf("%d", &x);
printf("Masukkan nilai y: ");
scanf("%d", &y);
printf("x + y = %d", x + y);
return 0;
}
Jenis placeholder:
%d, %i int
%f float
%c char
%s string(char* or char[])
%li long int
.
.
etc.
0 Response to "Input/Output Penjumlahan Dua Variabel"
Post a Comment