C program to change lower case to upper case
/*by ankit gehlot
     website:ankitcguru.blogspot.com/
*/
#include<stdio.h>
int main(){
  char str[20];
  int i=0;
  printf("Enter any string :");
  scanf("%s",str);
  while(str[i]!='\0'){
            if(str[i]>=97&&str[i]<=122){
            str[i]=str[i]-32;}i++;
  }
  printf("\nThe string in Upper case is :%s",str);
  return 0;
}
Output:-
Enter any string :ankit
The string in lowercase is :ANKIT
The string in lowercase is :ANKIT
Comments
Post a Comment