AD (728x60)

Diberdayakan oleh Blogger.

Sabtu, 07 Mei 2016

Mengubah huruf kecil dan besar

Share & Comment
Assalamualaikum w.w.
Buatlah algoritma dan function untuk mengubah huruf besar menjadi huruf kecil, kemudian buatlah function untuk mengubah string menjadi string yang hurufnya huruf besar semua.
input c++:

#include <iostream>
#include <string.h>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */

using namespace std;

int main(int argc, char** argv) {
    string a;
    cout<<"Masukkan kalimat : ";
    getline(cin,a);
    int b = a.length();
    cout<<"Dalam bentuk kapital : ";
    for(int c=0;c<=b;c++)
    {
        a[c]=toupper(a[c]);
        cout<<a[c];
    }
    cout<<endl;
    cout<<"Dalam bentuk huruf kecil : ";
    for(int d=0;d<=b;d++)
    {
        a[d]=tolower(a[d]);
        cout<<a[d];
    }
    cout<<endl;
   
    return 0;
}


output c++: 


waalaikumsalam w.w
http://al-likenet.blogspot.co.id/
http://dwiharlina.blogspot.co.id/
Tags:

Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 komentar:

Posting Komentar

 
Copyright © safirizky blogs | Designed by Templateism.com