Commit 9ddff55c by Nicolas Manurung

Update tutorial_1

parent 0b6b65b4
#include
\ No newline at end of file
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
int main(){
int i;
int s[5];
int n;
//statis
s[0] = 1;
s[1] = 2;
s[2] = 3;
s[3] = 4;
s[4] = 5;
for(i=0;i<5;i++){
printf("static ke-%d adalah %d\n",i+1,s[i]);
}
//dynamic
scanf("%d",&n);
int * d = (int *)malloc(sizeof(int)* n);
for( i = 0; i < n; i++ ){
printf("Masukkan Data ke-%d\n",i);
scanf("%d", &d[i]);
}
for(i=0;i<n;i++){
printf("static ke-%d adalah %d\n",i+1,d[i]);
}
return 0;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment