C program to convert lowercase to an uppercase string using ASCII values
kw.c
#include<stdio.h>
#include<string.h>intmain(){chars[20];inti;printf("———————————————————————————————————————————");printf("\nProgram to convert lower to an uppercase string");printf("\n———————————————————————————————————————————");printf("\nEnter the string ");scanf("%s",s);for(i=0;i<=strlen(s);i++){if(s[i]>=97&&s[i]<=122)s[i]=s[i]-32;}printf("\nThe uppercase string is %s",s);printf("\n———————————————————————————————————————————\n");return0;}
Output
kodingwindow@kw:~$ gcc kw.c kodingwindow@kw:~$ ./a.out
———————————————————————————————————————————
Program to convert lower to an uppercase string
———————————————————————————————————————————
Enter the string welcome
The uppercase string is WELCOME
———————————————————————————————————————————
kodingwindow@kw:~$
C program to convert lowercase to an uppercase string using toupper() function
kw.c
#include<stdio.h>intmain(){chars[20];inti;printf("———————————————————————————————————————————");printf("\nProgram to convert lower to an uppercase string");printf("\n———————————————————————————————————————————");printf("\nEnter the string ");scanf("%s",s);for(i=0;s[i];i++)s[i]=toupper(s[i]);printf("\nThe uppercase string is %s",s);printf("\n———————————————————————————————————————————\n");return0;}
Output
kodingwindow@kw:~$ gcc kw.c kodingwindow@kw:~$ ./a.out
———————————————————————————————————————————
Program to convert lower to an uppercase string
———————————————————————————————————————————
Enter the string welcome
The uppercase string is WELCOME
———————————————————————————————————————————
kodingwindow@kw:~$
Dear User, Thank you for visitng Kodingwindow. If you are interested in technical articles, latest technologies, and our journey further, please follow us on LinkedIn.
Dear User, We are grateful for your interest in the Kodingwindow Android app. We intend to soon make it available on the Google Play Store. Currently, Android versions 10 and up require manual apk installations. Would you like to get the app?