Learn C ProgrammingLearn ProgrammingPrograms On StringsResources

087. Write a program to convert given string to UPPER CASE in C language

By September 18, 2012 September 5th, 2018 No Comments
#include<stdio.h>
#include<conio.h>  
main()
{
	int i;
	char *s1;
	clrscr();
	printf("Enter the string 1....");
	scanf("%s",s1);

	for(i=0;s1[i]!='\0';i++)
	{
		if((s1[i]>='a')&&(s1[i]<='z'))
			s1[i]=s1[i]-32;
	}
	printf("Resultant string is...%s",s1);
	getch();
}


Leave a Reply

DEMO01