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 11th November 2011
Braincode's Avatar
Braincode Braincode is offline
Ceriwis Addicted
 
Join Date: Nov 2011
Posts: 4,638
Rep Power: 20
Braincode mempunyai hidup yang Normal
Default Masalah Manipulasi string di C ?

Sebemlum'y buat om momod maaf ya ts ane yg tdi klo tdak sesuai dgn rule

masklum msi nubie



buat agan2 master C



gini gan Ane bru dapet tugas Strukturdata



soal'y :



Masukkan himpunan A dan B yang masing-masing anggotanya adalah karakter.

Tampilkan output gabungan antara A dan B. Batasi jumlah karakter tidak lebih dari 20.



Contoh: input

Kalimat A = abcdef

Kalimat B = bdfghi





Tampilan output:



A = {a, b, c, d, e, f}

B = {b, d, f, g, h, i}



A gabung B = { a, b, c, d, e, f, g, h, i }





swaktu ane coba



#include

#include

#include



#define MAX 6



int main()

{

char A[MAX];

char B[MAX];



printf("\n Kalimat A : ");scanf("%s", A);

printf("\n Kalimat B: ");scanf("%s", B);



strcat(A,B);

puts(A);





}



ketika ane compile dan ane run



input

kalimat A = abcdef

anggota B = bdfghi

out put'y "abcdefbdfghi"



biar output'y "abcdefghi" gmana ya gan..



skli lagi maaf ya gan kalo salah post..

maklum msi nubie...





Reply With Quote
Reply

Thread Tools

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 08:42 PM.


no new posts