Commit 73799278 by Nicolas Manurung

Add new file

parent 188bfb71
#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;
}
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