Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main()
- {
- int NILAI[12] = {60,80,55,90,75,40,50,85,70,65,45,55};
- int LULUS[12] ={};
- int GAGAL[12] ={};
- int I, J,K;
- printf("Isi Array A : ");
- for (I=0; I<12; I++) {
- printf("%3i", NILAI[I]);
- }
- J = 0;
- for (I=0; I<12; I++) {
- if (NILAI[I]>=60) {
- LULUS[J] = NILAI[I];
- J++;
- }
- }
- J = 0;
- for (I=0; I<12; I++) {
- if (NILAI[I]<60 ) {
- GAGAL[J] = NILAI[I];
- J++;
- }
- }
- printf("\nLULUS : ");
- for (I=0; I<12; I++) {
- printf("%3i", LULUS[I]);
- }
- printf("\nGAGAL : ");
- for (I=0; I<12; I++) {
- printf("%3i", GAGAL[I]);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement