Ceriwis

Ceriwis (https://forum.ceriwis.com/forum.php)
-   Programming (https://forum.ceriwis.com/forumdisplay.php?f=63)
-   -   <help> bikin frekuensi karakter (https://forum.ceriwis.com/showthread.php?t=573471)

Permenkaret 20th November 2011 01:43 AM

<help> bikin frekuensi karakter
 
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..


All times are GMT +7. The time now is 03:34 AM.