Skip to content

Instantly share code, notes, and snippets.

@rahuladream
Created October 9, 2017 20:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rahuladream/7e832f9754d368d702bc4d51ab381bdb to your computer and use it in GitHub Desktop.
Save rahuladream/7e832f9754d368d702bc4d51ab381bdb to your computer and use it in GitHub Desktop.
Upper String Without using function
#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