Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
Kelompok_Belajar_Alstrudat
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nicolas Manurung
Kelompok_Belajar_Alstrudat
Commits
3719eed1
Commit
3719eed1
authored
Mar 14, 2019
by
Nicolas Manurung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add new file
parent
682cd2e6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
0 deletions
+34
-0
Tutorial 1|Dynamic & Statis Array
Tutorial 1|Dynamic & Statis Array
+34
-0
No files found.
Tutorial 1|Dynamic & Statis Array
0 → 100644
View file @
3719eed1
#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;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment