Problem statement:- Program to Convert Lowercase to Uppercase using the inbuilt function.
Data requirement:-
Input Data:- str
Output Data:-str
Output Data:-str
Program in C
Here is the source code of the C Program to Convert Lowercase to Uppercase using the inbuilt function.
Code:
#include<stdio.h>
#include<string.h>
int main()
{
char str[30];
printf("Enter your String(Lower case):");
scanf("%[^\n]",str);
printf("Upper case String is:%s",strupr(str));/*strupr convert small letter string to capital letter string*/
}
Input/Output:#include<string.h>
int main()
{
char str[30];
printf("Enter your String(Lower case):");
scanf("%[^\n]",str);
printf("Upper case String is:%s",strupr(str));/*strupr convert small letter string to capital letter string*/
}
Enter your String(Lower case):csinfo360.com
Upper case String is:CSINFO360.COM
Upper case String is:CSINFO360.COM
Program in C++
Here is the source code of the C++ Program to Convert Lowercase to Uppercase using the inbuilt function.
Code:
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
string str;
cout<<"Enter your String(Lower case):";
getline(cin,str);
int len=0;
string str2="";
while(str[len]!='\0')
{
str2+=toupper(str[len]);
len++;
}
cout<<"Upper case String is: "<<str2;
}
Input/Output:#include<cstring>
using namespace std;
int main()
{
string str;
cout<<"Enter your String(Lower case):";
getline(cin,str);
int len=0;
string str2="";
while(str[len]!='\0')
{
str2+=toupper(str[len]);
len++;
}
cout<<"Upper case String is: "<<str2;
}
Enter your String(Lower case):csinfo 360 com
Upper case String is: CSINFO 360 COM
Upper case String is: CSINFO 360 COM
Program in Java
Here is the source code of the Java Program to Convert Lowercase to Uppercase using the inbuilt function.
Code:
import java.util.Scanner;
public class p5 {
public static void main(String[] args) {
Scanner cs=new Scanner(System.in);
String str;
System.out.println("Enter your String(Lower case):");
str=cs.nextLine();
System.out.println("Upper case String is: "+str.toUpperCase());
cs.close();
}
}
public class p5 {
public static void main(String[] args) {
Scanner cs=new Scanner(System.in);
String str;
System.out.println("Enter your String(Lower case):");
str=cs.nextLine();
System.out.println("Upper case String is: "+str.toUpperCase());
cs.close();
}
}
Enter your String(Lower case):
csinfo360
Upper case String is: CSINFO360
csinfo360
Upper case String is: CSINFO360
Program in Python
Here is the source code of the Python Program to Convert Lowercase to Uppercase using the inbuilt function.
Code:
str=input("Enter the String(Lower case):")
print("Upper case String is:", str.upper())
print("Upper case String is:", str.upper())
Input/Output:
Enter the String(Lower case):csinfo
Upper case String is: CSINFO
Upper case String is: CSINFO
0 Comments
Please do not Enter any spam link in the comment box