Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- using namespace std;
- char* toLowerCase(char* napis)
- {
- for (int i = 0; i <= strlen(napis); i++)
- {
- if (napis[i] >= 'A' && napis[i] <= 'Z')
- {
- napis[i] = napis[i] + 32;
- }
- }
- return napis;
- }
- char* toUpperCase(char* napis)
- {
- for (int i = 0; i <= strlen(napis); i++)
- {
- if (napis[i] >= 'a' && napis[i] <= 'z')
- {
- napis[i] = napis[i] - 32;
- }
- }
- return napis;
- }
- int main()
- {
- char* napis1 = "ALA";
- char* napis2 = "ala";
- cout << toUpperCase(napis2) << endl << toLowerCase(napis1) << endl;
- getchar();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment