• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar

Aspiration Classes

  • Join Now
  • contact@aspirationclassess.com
  • +91 9831 913 909
  • Home
  • About Us
  • Subjects Taught
  • Resources
    • ICSE
      • ICSE Computer Applications
      • ICSE Chemistry
      • ICSE Biology
      • ICSE Chemistry
      • ICSE Commerce
      • ICSE Maths
      • ICSE Physics
    • ISC
      • ISC Computer
      • ISC Physics
      • ISC Chemistry
      • ISC Maths
      • ISC Accounts
      • ISC Biology
  • Notice
  • Contact Us

Blog

Home / ICSE / Write a program to input a string and change the uppercase letters into small case and vice-versa
  • ICSE
  • ICSE Computer Applications

Write a program to input a string and change the uppercase letters into small case and vice-versa

By Faseel Anwar - 12/03/2014

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import java.io.*;
public class casechange
{
    public static void main()throws IOException
    {
        BufferedReader r = new BufferedReader(new InputStreamReader(System.in));
        String s, s2="";
        int l, i, j;
        char ch;
        System.out.println("Enter a string:");
        s = r.readLine();
        l = s.length();
        for(i=0;i<l;i++)
        {
            ch = s.charAt(i);
            if(ch>='A'&&ch<='Z')
                ch = (char)(ch+32);
            else if(ch>='a'&&ch<='z')
                ch = (char)(ch-32);
            s2+=ch;
        }
        System.out.println("Input: "+s);
        System.out.println("Output: "+s2);
    }
}

1
2
3
4
5
<h3>Output</h3>
Enter a string:
This Is the COUNtry of INDIA
Input: This Is the COUNtry of INDIA
Output: tHIS iS THE counTRY OF india

Related Posts

  • Sample ISC Practical Question SolvedWrite a program to input a string and change the letters in upper case to lower case and vice versa.
  • Sample ISC Practical Question SolvedWrite a program to input a sentence and print the words in odd positions in capital letters and those in even positions in small letters.
  • Sample ISC Practical Question SolvedWrite a program in java to print the values of X and Y where X = 0,1,2,3,4…10 and Y is given by the babbage function Y = X² + X + 41

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on Google+ (Opens in new window)

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Find us on facebook

Facebook By Weblizar Powered By Weblizar

Search the website

Recent Posts

  • Study for IIT – JEE Mains and Advanced from an all IITian faculty
  • ICSE Maths Mock Test Paper – 2
  • ICSE Maths Mock Test Paper – 3
  • Write a program to implement an array based Dequeue
  • Write a program to implement an array based queue

Recent Comments

  • prostate vibrator on ISC 2018 – Computer Practical Question 1 Solution

Categories

  • Engineering (3)
  • ICSE (114)
  • ICSE Biology (2)
  • ICSE Chemistry (7)
  • ICSE Commerce (4)
  • ICSE Computer Applications (108)
  • ICSE Economics (2)
  • ICSE English (2)
  • ICSE Maths (8)
  • ICSE Physics (7)
  • ISC (84)
  • ISC Accounts (3)
  • ISC Biology (2)
  • ISC Chemistry (7)
  • ISC Commerce (1)
  • ISC Computer (71)
  • ISC Economics (1)
  • ISC English (1)
  • ISC Maths (6)
  • ISC Physics (12)
  • Notices (10)
  • Others (16)
  • Uncategorized (1)

ISC POPULAR POSTS

Write a program to implement an array based Dequeue

February 22, 2018

Write a program to implement an array based queue

February 22, 2018

Write a program to implement an array based STACK

February 22, 2018

ICSE POPULAR POSTS

ICSE Maths Mock Test Paper – 2

February 25, 2018

ICSE Maths Mock Test Paper – 3

February 25, 2018

ICSE Commercial Application Mock Question paper – 1

February 19, 2018

OTHER POPULAR POSTS

Write a program to implement an array based Dequeue

February 22, 2018

Write a program to implement an array based queue

February 22, 2018

Write a program to implement an array based STACK

February 22, 2018
ABOUT US
Aspiration Classes is a venture of like minded people from various backgrounds who seek to provide high quality assistance to school and college going students.
Contact us: contact@aspirationclasses.com
FOLLOW US
  • Disclaimer
  • Privacy Policy
  • Advertisement
  • Contact Us

© Copyright 2017 - Designed & Developed by Trian Technologies