Created
October 9, 2017 20:14
-
-
Save rahuladream/7e832f9754d368d702bc4d51ab381bdb to your computer and use it in GitHub Desktop.
Upper String Without using function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
char* mystrupr(char *s); | |
int main() | |
{ | |
char str[20]; | |
puts("Enter a string"); | |
cin>>str; | |
mystrupr(str); | |
cout<<"Upper case is : >> "<<str; | |
} | |
char *mystrupr(char* s) | |
{ | |
int i=0; | |
while(s[i]!='\0') | |
{ | |
if(s[i]>=97 && s[i]<=122) | |
s[i]=s[i]-32; | |
i++; | |
} | |
return s; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment