How to write a C Program to convert a string to upper case in C Programming Language ?
This C Program to convert a string to upper case.
Solution:
- #include<stdio.h>
- #include<string.h>
- main()
- {
- char s[50];
- int i,l;
- printf("Enter some text: ");
- gets(s);
- l=strlen(s);
- for(i=0;i<l;i++)
- {
- if(s[i]>='a'&&s[i]<='z')
- s[i]-=32;
- }
- printf("Text after converting to upper case: ");
- puts(s);
- }
Learn More :
String
- Write a c program to check given string is palindrome number or not.
- C Program to Convert Text String to Binary
- C Program String - Alphabet Count Example
- C Program String Example
- C Program String Count Example
- C Program String Example
- C Program to Print a String Without Use Semicolon.
- C Program To Find Length Of A String Including Blank Spaces, Tabs, And Other Special Characters
- C Program To Find Length Of String And Concatenate Two Strings
- C Program To Find The Length, Reverse Of A String And To Check It Is Palindrome or Not
- C Program To Print String In Formatted Output Form
- C Program To Reverse The String Using Pointer
- C Program Concatenating Two Strings Into A Third System
- C Program Date from string DDDD-DD-DD
- BUILDS A STRING FROM THE LSB BITS OF EACH PIXEL
- C Program Finds Sub-String Search in String
- C Program to concatenate two strings without using string functions
- C Program to Count Vowels, Consonants and Spaces in a string
- C Program Performs a search and replace for a specified target and replacement string
- C Program Anagrams
- C Program to find string length without library function
- C Program to Check Given String is Palindrome or Not
- C Program to Converts a Number to a String.
- Design a C function that shortens a string to 8 characters
Convert
- How To Write a C program that reads your first and last names and then converts them to upper-case and lower-case letters. The results will be printed to standard output console.
- C Program to Convert Text String to Binary
- C Program To Convert Decimal To Binary Using Recursion
- C Program To Convert Temperature In Celsius To Fahrenheit, Using Function
- C Program To Convert Temperature Into Celsius
- C Program to Convert Celsius to Fahrenheit temperature
- C Program Convert MIDI note to pitch
- C Program to Convert Celcius to Fahrenheit and vice versa
- C Program to Convert a Decimal number to Octal Number
- C Program to Convert Number to Words in C
- C Program to Converts a Number to a String.
- C Program to Convert Celsius Temperature into Fahrenheit Temperature
- C Program to Recursively converts all file-names to lower-case
- C Program to accept string from user & convert all lower case letters into upper case letters & vice versa
- C Program to convert given decimal number into binary number
- C Program To Read The Adjecancy Matrix of Directed Graph And Convert It Into Adjecancy List
Upper Case
- How To Write a C program that reads your first and last names and then converts them to upper-case and lower-case letters. The results will be printed to standard output console.
- C Program To Print Text Into Uppercase
- Lower-Upper Case/Positive-Negative Integer
- C Program Anagrams
- C Program to accept string from user & convert all lower case letters into upper case letters & vice versa