Program to change string to upper case using function

#include<stdio.h>
#include<string.h>
#include<ctype.h>
void upper(char a[]);
void main()
{
char a[80];
printf("\n enter a string");
scanf("%[^\n]",a);
upper(a);
}
void upper(char a[])
{
int len,i;
len=strlen(a);
for(i=0;i<len;i++)
{
a[i]=toupper(a[i]);
}
printf("\n%s",a);
}

No comments:

Post a Comment