Breaking News
Loading...
Minggu, 17 April 2016

Mengubah Kata Besar Kecil

Source Code :



#include<iostream> 
                #include<conio.h> 
                #include<string.h> 
                using namespace std; 
int main(int argc, char** argv) 
                { 
               
       char string[70]; //deklarasi variabel
       int jum_karakter;
     
       cout<<"Mengubah Kata ke besar kecil"<<endl;
       cout<<"---------------------------------"<<endl;
       cout<<"Masukkan String : ";
       cin.getline(string, sizeof(string));

       for(int i = 0; string[i]; i++)
              if(i%2==0) {
                strupr(string); 
                                                                cout<<string[i];
              }
              else{
                strlwr(string);
                                                                  cout<<string[i]; 
              }
                 
               
 return 0;
                } 

Hasilnya :

 

0 komentar:

Posting Komentar

Copyright © 2014 My Blog My Adventure All Right Reserved