Senin, 04 April 2011

BELAJAR PROGRAM "MEMASUKKAN STRING"


#include <iostream.h>
#include <conio.h>
#include <string.h>
void main(){
char st [128];
char cpp[]="C++";
cout<< "Masukan sebarang string"<< endl;
cin.getline(st,sizeof   (st));
int hasil = strcmp(st, cpp);
if (hasil==0)
cout<<st<<"=="<<cpp<<endl;
else if (hasil=0)
cout<<st<<"<"<<cpp<<endl;
else
cout<<st<<">"<<cpp<<endl;
}

Tidak ada komentar:

Posting Komentar