Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
Guesuper Guesuper is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 408
Rep Power: 14
Guesuper mempunyai hidup yang Normal
Default [ask]Algoritma searching char-string

Ane ada tugas gan,tp gak selesai2. Nyari algoritma searching, tp yang di cari itu tipe character string.



kodenya ini gan:


Code:

#include "stdio.h"
#include "stdlib.h"

struct dataNilai{
char NIM[10];
char namaMahasiswa[10];
int nilaiTugas;
int nilaiUTS;
int nilaiUAS;
double nilaiTotal;
char nilaiAkhir;
};

int main(){
printf("DATA NILAI MAHASISWAn\n");
printf("====================\n");
int jumlahMahasiswa;
printf("Masukkan jumlah mahasiswa yang akan dimasukkan datanya: "); scanf("%i", &jumlahMahasiswa);
dataNilai data[jumlahMahasiswa];

printf("\n\n");
for(int i=0; i= 60){
data[i].nilaiAkhir = 'C';
}
else if(data[i].nilaiTotal >= 50){
data[i].nilaiAkhir = 'D';
}
else if(data[i].nilaiTotal >= 40 ){
data[i].nilaiAkhir = 'E';
}
else if(data[i].nilaiTotal < 40){
data[i].nilaiAkhir = 'F';
}
}*/
printf("\n");

for(int i=0; ifor (int i=0; i

Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 04:28 PM.


no new posts