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
Permenkaret Permenkaret is offline
Ceriwiser
 
Join Date: Nov 2011
Posts: 351
Rep Power: 14
Permenkaret mempunyai hidup yang Normal
Default [ASK]ada error nih diprogram C ane

nih kode2nya


Code:

#include
#include
#include
#include
#include
#include
void main() {
awal:
clrscr();
char A;
string L;
coutA;
if(isdigit(A)) {
printf("inputan anda adalah numeric\n");
}
if(isalpha(A)) {
printf("inputan anda adalah bukan numeric\n");
}
akhir:
coutL;
if(L=="Y" || L =="y"){
goto awal;
}
if(L=="N" || L=="n"){
printf("Selesai");
}
else
goto akhir;
}

itu niatnya ane pengen saat program berakhir dia bakal muncul pertanyaan untuk mengulang kembali ato gak tapi pas ane jalanin kok pertanyaannya muncul sebanyak 2 kali kalo jumlah inputannya lebih dari sekali

misalnya inputannya "12","123","1234",dst nanti munculnya pertanyaannya 2 kali

kalo inputannya "1","2","3",dst nanti pertanyaanya jadi sekali doang

nah ane pengennya muncul pertanyaannya sekali aja walaupun inputannya lebih dari sekali

mohon bantuannya dong mastah2



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 12:24 AM.


no new posts