Permenkaret
20th November 2011, 01:43 AM
ini gan contoh input/outputnya...
input>a
input>b
input>a
input>spasi
hasil :
a=2
b=1
ini hasil ane..
Code:
#include
#include
void main ()
{
printf ("+////////////////////////////////////+\n");
printf (" Program mencetak frekuensi karakter\n");
printf ("+////////////////////////////////////+\n\n");
char n[50],tombol,x=0;
int i=0,k,p;
while (tombol !=32)
{
x++;
printf (" Masukkan inputan %d : ",x);
scanf ("%c",&n[i]);
i++;
printf ("\n");
fflush(stdin);
printf (" tekan 'ENTER' untuk lanjut / tekan 'SPASI' untuk keluar\n\n");
tombol=getch();
}
for (int j=0;jc
input>e
input>spasi
hasil:
e=2
c=2
e=2
gimana tuh gan..???apa yg salah ya..
mohon petunjuknya gan..
input>a
input>b
input>a
input>spasi
hasil :
a=2
b=1
ini hasil ane..
Code:
#include
#include
void main ()
{
printf ("+////////////////////////////////////+\n");
printf (" Program mencetak frekuensi karakter\n");
printf ("+////////////////////////////////////+\n\n");
char n[50],tombol,x=0;
int i=0,k,p;
while (tombol !=32)
{
x++;
printf (" Masukkan inputan %d : ",x);
scanf ("%c",&n[i]);
i++;
printf ("\n");
fflush(stdin);
printf (" tekan 'ENTER' untuk lanjut / tekan 'SPASI' untuk keluar\n\n");
tombol=getch();
}
for (int j=0;jc
input>e
input>spasi
hasil:
e=2
c=2
e=2
gimana tuh gan..???apa yg salah ya..
mohon petunjuknya gan..