top of page
#include<stdio.h>
#include<string.h>
void myToUpperFunction(char[]);
int main(void){
char string[50];
printf("Enter a string :\n");
scanf("%s",string);
myToUpperFunction(string);
printf("New string :%s",string);
return 0;
}
void myToUpperFunction(char str[]){
int i;
for(i=0;i<=strlen(str);i++){
if(str[i]>=97&&str[i]<=122)
str[i]=str[i]-32;
}
}
bottom of page