Study notes, mock papers & programming tutorials
88 articles recovered from the archive, covering ICSE / ISC programming, mathematics, and board exam practice.
- Programming
Write a program to implement an array based Dequeue
Java Program on Dequeue Dequeue or Double Ended Queue is a generalized version of Queue data structure that allows insert and delete at both ends. Operations on Deque: Mainly the following four basic operations are…
- Programming
Write a program to implement an array based queue
Java Program on Queue This is a Java Program to implement a queue using array. Queue is a particular kind of abstract data type or collection in which the entities in the collection are kept in order and the principal…
- Programming
Write a program to implement an array based STACK
The following post is made to implement array based stack using java programming language In computer science, a stack is an abstract data type that serves as a collection of elements, with two principal operations:…
- ProgrammingISC
ISC – Java Program to implement a linked list
A linked list is a way to store a collection of elements. Like an array these can be character or integers. Each element in a linked list is stored in the form of a node . Node : A node is a collection of two…
- Programming
Java program on Kaprekar Number
Kaprekar Number In mathematics, a non-negative integer is called a “ Kaprekar number ” if its square can be split into two parts that add up to the original number. For instance, 45 is a Kaprekar number, because 45 2 =…
- ISCComputer Science
ISC 2018 – Computer Practical Question 2 Solution
ISC 2018 Computer Practical Write a program to declare a matrix A[ ] [ ] of order (M xN) where ‘M’ is the number of rows and ‘N’ is the number of columns such that the values of both ‘M’ and ‘N’ must be greater than 2…
- ISCComputer Science
ISC 2018 – Computer Practical Question 1 Solution
ISC 2018 Computer Practical Question 1 A Goldbach number is a positive even integer that can be expressed as the sum of two odd primes. Note: All even integer numbers greater than 4 are Goldbach numbers. Example: 6 = 3…
- ISCComputer Science
ISC 2018 – Computer Practical Question 3 Solution
ISC 2018 Computer Practical The names of the teams participating in a competition should be displayed on a banner vertically, to accommodate as many teams as possible in a single banner. Design a program to accept the…
- ISCProgramming
ISC practical – Amicable numbers between 1 and a number given by the user
Amicable numbers are two different numbers so related that the sum of the proper divisors of each is equal to the other number. The smallest pair of amicable numbers is (220, 284). They are amicable because the proper…
- ProgrammingISC
ISC Practical Program – ISC 2004
Number have different representations depending on the bases on which they are expressed. For example in base 3, the number 12 is written as 110 , but in base 8 it is written as Consider, for example, the integers 12…
- ISC
Merging Arrays – ISC 2001
Write a program which input natural number N and M followed by integer arrays A[] and B[], each consisting of N and M number of elements respectively. Sort the arrays A[] and B[] in descending order of magnitude. Use…
- ISCSolutions
Practical Questions ISC 2001
Consider the sequence of natural number:- 1, 2, 3, 4, 5, 6, 7……………………………… Removing every second number produces the sequence 1, 3, 7, 9, 11, 13, 15, 17………………………… Removing every third number from the above sequence…
- General
Classes for Data Structure
Classes for Data Structures will commence from Saturday 22 nd of July 2017 at 5:30 pm. All those students who are interested in joining please contact us on 9831913909. Fully projector based practical classes with…
- Mock Paper
JEE Main 2017: An analysis of the entrance exam question paper
The Joint Entrance Examination-Mains (JEE-Mains) 2017 was held on Sunday for admission in engineering colleges, including the Indian Institutes of Technology (IITs). Around 10 lakh students from across the country…
- Programming
Write a program in Blue J to input a sentence and print those words whose all characters are unique.
import java.io.*; class Unique_Characters //Class Name { public static void main()throws IOException { int i,l,check=0; char ch; String str,str1="",str2=""; BufferedReader br=new BufferedReader(new…
- Programming
Write a program to input a number and print if it is a Double Armstrong number or not
ICSE Program A double armstrong number is a number that is equal to the sum of its digits where each digit is raised to the power of the number of digits in the number. Eg: 153 370 371 407 1634 8208 9474 Explanation:…
- ICSEChemistry
Conversion Chart – Organic Chemistry ICSE
Organic Chemistry Conversion Chart The following hardwritten chart is a tool to identify and understand the various possible conversions in Organic chemistry. Use the chart to follow and understand how we can convert…
- Programming
Array based Circular Queue – Java
Circular Queue In a normal Queue Data Structure, we can insert elements until queue becomes full. But once if queue becomes full, we can not insert the next element until all the elements are deleted from the queue. For…
- Programming
Library Functions – String Class
String class functions The following methods are some of the most commonly used methods of String class. charAt() charAt() function returns the character located at the specified index. String str = "studytonight";…
- Programming
Write a program to input multiple sentences each terminating with “.”, “!” or “?”. Sort the words of each sentence in alphabetical order.
Write a program to input multiple sentences each terminating with “.”, “!” or “?”. Sort the words of each sentence in alphabetical order. /* WAP to input multiple sentences each terminating with ".", "!" or "?". Sort…
- ISCComputer Science
Computer Science – ISC 2015 Question 1
Computer Science ISC 2015 Given two positive numbers M and N, such that M is between 100 and 10000 and N is less than 100. Find the smallest integer that is greater than M and whose digits add up to N. For example, if…
- Programming
Write a program to input a number and print the frequency of each digit
The program will take a number as input and print how many times each digit occurs in the number. The frequency of the digits which are not present in the number will not be printed. import java.util.*; public class…
- Programming
Write a program to input a string and delete every occurrence of a word given by the user
import java.io.*; public class String13 { public static void main()throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s, w="", wd, s2=""; int i, l, c=0; char ch;…
- Physics
Physics for JEE 2016: Advance Illustrations of Gravitational Field and Satellite Motion
Change in Orbit of a Satellite: When a satellite is orbiting around the earth in an orbit of a given radius, and for some reasons we need to shift the satellite from one orbit to another, work is required to be done in…
- ProgrammingICSE
Class 10 ICSE Computer Question Paper – St. Xavier's solved.
SECTION B Question 4 Define a class Numbers describes as below: Data Members: n1, n2, n3, maximum and average Member Methods: A parameterised constructor to initialise the data members. To compute the average and the…
- General
Linear Search in Array
Java program for linear search: Linear search is very simple, To check if an element is present in the given list we compare search element with every element in the list. If the number is found then success occurs…
- ICSEISC
Wishing all ICSE and ISC 2015 candidates the very best of luck for their results.
The results of the Class X(ICSE) and Class 12(ISC) 2015 Examinations will be declared today at 11:30 a.m. The results will be made available through the Website of the Council and through SMS. Individual Candidates can…
- Programming
Write a program in Java to input a year and print whether it is a leap year or not.
A leap year has 366 days, as opposed to a common year, which has 365. Nearly every 4 years is a Leap Year, and we add a Leap Day, an extra – or intercalary – day on February 29. Leap Years are needed to keep our modern…
- Programming
Biology Classes For Class 11 and 12 Commences from 10th May 2015
[vc_row type=”in_container” bg_position=”left top” bg_repeat=”no-repeat” parallax_bg=”true” bg_color=”#ffffff” text_color=”dark” text_align=”center”][vc_column width=”1/1″ enable_animation=”true” animation=”fade-in”…
- Programming
Write a program to input a sentence and print the words in odd positions in capital letters and those in even positions in small letters.
import java.util.*; public class Word_Alt_Case { String toLowerCase(String x) { int i; String op=""; char ch; for(i=0;i<x.length();i++) { ch = x.charAt(i); if(ch>='A'&&ch<='Z') ch = (char)(ch+32); op = op+ch; } return…
- Programming
Pass by Reference
Passing by Reference means the called functions’ parameter will be the same as the callers’ passed argument (not the value, but the identity – the variable itself). Pass by value means the called functions’ parameter…
- Programming
Write a program in C to input an array and sort it using Binary Search Tree sorting algorithm
#include<stdio.h> #include<conio.h> #include<malloc.h> typedef struct node { int d; struct node *right, *left; }Node; int k, a[10]; Node *root=NULL; void add(int data) { int x, y; Node *p, *q; p = (Node…
- Programming
Write a function in C programming language that takes an array pointer and the size of the array as parameter and sorts it in ascending order.
#include<stdio.h> #include<conio.h> void bubble(int *p, int n) { int i, j, tmp; printf("nInside Bubble Functionn"); for(i=0;i<n;i++) { for(j=0;j<n-1-i;j++) { if(*(p+j)>*(p+j+1)) { tmp = *(p+j); *(p+j) = *(p+j+1);…
- Programming
Write a program to input a limit 'L' and print all the prime numbers between 1 to L.
import java.io.*; public class PrimeRange { public static void main()throws IOException { BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); int i, j, s=0, n, l; System.out.println(“Enter the…
- Programming
Write a program in Java to input a number and print only those digits that are prime
public class Prime_Digits { public static void main(int n) { int d; while(n!=0) { d = n%10; n = n/10; if(d==2||d==3||d==5||d==7) System.out.println(d); } } }
- Programming
Write a program in C programming language to implement a Binary Search
The program will add a node to the tree Perform Inorder Traversal Perform Preorder Traversal Perform Postorder Traversal #include<stdio.h> #include<conio.h> #include<malloc.h> typedef struct node { int d; struct node…
- Programming
Write a program in C to implement a circular linked list
The program also includes the Josephus Problem #include<stdio.h> #include<conio.h> #include<malloc.h> typedef struct node { int d; struct node *link; }Node; Node *head=NULL; void append() { Node *p, *q; p = (struct node…
- Programming
2D Array: Write a program to input a matrix of size m x n do the following:
Print the original matrix Print the transpose matrix Print the product of the original matrix and the transpose Transpose of a Matrix To “transpose” a matrix, swap the rows and columns. We put a “T” in the top…
- Programming
Class 11 and 12: Write a program to input a string and encode it by moving each alphabet 'n' places forward in a circular manner.
Where n is any number between 1 – 26 In circular forward encoding if on encoding the program crosses 'z' then it will go back to 'a'. Example: If 'x' has to be encoded 5 places forward then it will be as follows…
- Programming
Write a program in C to implement a Linked List Based Stack:
#include<stdio.h> #include<conio.h> #include<malloc.h> typedef struct node { int d; struct node *link; }Node; Node *head=NULL; void append() { Node *p, *q; int x; p = (struct node *)malloc(sizeof(struct node)); p->link…
- Programming
Write a Program in C to demonstrate a singly linked list.
The program will use separate functions to do the following tasks: 1. Add a node at the end of the Linked List. 2. Add a node at the start of the Linked List. 3. Delete a node at the end of the Linked List. 4. Delete a…
- Programming
Write a program to input a sentence and sort each word in increasing order of the length of the words. If the length is same then sort the words in alphabetical order.
import java.util.*; public class Word_Sort_Length_lexi { public static void main() { Scanner sc = new Scanner(System.in); String s, s2[], w="", tmp; int i, l, c=0, k=0, j; char ch; System.out.println("Enter a string:");…
- Programming
Class 11: Write a program to input a number and a limit and print it as given.
Enter a number: 45 Enter the limit: 8 Values are: 56 67 78 89 910 1021 2132 3243 import java.util.*; public class Next_Num { public int Change(int n) { String x = ""+n, op=""; int l = x.length(), i, d; char ch;…
- Programming
Class 11: Write a program to input a string and print the number of words that start with a vowel.
import java.io.*; public class Word_Vowel { boolean isVowel(char ch) { if(ch=='A'||ch=='E'||ch=='I'||ch=='O'||ch=='U'||ch=='a'||ch=='e'||ch=='i'||ch=='o'||ch=='u') return true; else return false; } public void…
- Programming
Write a program to illustrate the use of Malloc Function in C and sort an array in ascending order using a function Bubble
#include<stdio.h> #include<conio.h> #include<malloc.h> void bubble(int *p, int n) { int i, j, tmp; for(i=0;i<n;i++) { for(j=0;j<n-1-i;j++) { if(*(p+j)>*(p+j+1)) { tmp = *(p+j); *(p+j) = *(p+j+1); *(p+j+1) = tmp; } } } }…
- Programming
Write a program in C to input an array of size 10 and pass its address to a function Selection which sorts it in ascending order by Selection Sort Method. Print the resulting matrix
#include<stdio.h> #include<conio.h> void selection(int *p, int n) { int i, j, min, minp, tmp; for(i=0;i<n;i++) { min = *(p+i); minp = i; for(j=i+1;j<n;j++) { if(min>*(p+j)) { min = *(p+j); minp = j; } } tmp = *(p+i);…
- Programming
Write a program in C to input an array of size 10 and pass its address to a function Bubble which sorts it in ascending order. Print the resulting matrix
#include<stdio.h> #include<conio.h> void bubble(int *p, int n) { int i, j, tmp; for(i=0;i<n;i++) { for(j=0;j<n-1-i;j++) { if(*(p+j)>*(p+j+1)) { tmp = *(p+j); *(p+j) = *(p+j+1); *(p+j+1) = tmp; } } } } void main() { int…
- Programming
Write a program to print the following pattern:
A ABA ABCBA ABCDCBA ABCDEDCBA ABCDCBA ABCBA ABA A import java.util.*; public class Pattern_Diamond102 { public static void main() { Scanner sc = new Scanner(System.in); int n, i=0, j, X; char k;…
- Programming
Write a Program to print the following pattern:
* *** ***** ******* ********* ******* ***** *** * import java.util.*; public class Pattern_Diamond101 { public static void main() { Scanner sc = new Scanner(System.in); int n, i=0, j, X; System.out.println("Enter the…
- PhysicsMock Paper
PHYSICS Mock Test On Section B
PHYSICS MOCK TEST TIME 45MIN MARKS 30 Section –A (i) What kind of source produces a cylindrical wave front? (ii) On which factors does the deviation produced by a thin prism depend? (iii) A convex lens forms a virtual…
- Programming
Write a program to print the first 20 terms of the Fibonacci Series: 0, 1, 1, 2, 3, 5, 8, 13 …
Click here to know more about the Fibonacci Sequence /* * Write a program to print the first 20 terms of the Fibonacci Series * 0 + 1 + 1 + 2 + 3 + 5 + 8 + 13 ... */ public class Fibonacci { public static void main() {…
- Programming
Write a program to input an array of size n and delete a value from a position given by the user
import java.util.*; public class Array_Delete { public static void main() { Scanner sc = new Scanner(System.in); int a[], n, i, p; System.out.println("Enter the size of the array:"); n = sc.nextInt(); a = new int[n];…
- Programming
Write a program to store the first 30 terms of the Tribonacci Series in an Array and display it.
Tribonacci Series: 0 1 2 6 11 20 37... public class Tribo_Array { public static void main() { int t[] = new int[30], i; t[0] = 0; t[1] = 1; t[2] = 2; for(i=3;i<30;i++) { t[i] = t[i-1]+t[i-2]+t[i-3]; }…
- Programming
WAP to input a number n and print the sum of the following series: 1 + 8 + 27 + 64 + 125
public class Sum_cb { public static void main(int n) { int i, s=0; for(i=1;i<=n;i++) { s = s+i*i*i; } System.out.println("Sum= "+s); } }
- Programming
Write a program to input an int array of size 'n' and print all those values that are greater than the average
import java.util.*; public class Avg_great { public static void main() { Scanner sc = new Scanner(System.in); int n; System.out.println("Enter the size of the array:"); n = sc.nextInt(); int a[] = new int[n], i, s=0;…
- Programming
Write a program to input an array of size 10 and another value to search in the array using Linear Search Method. If the number is found then print the position of the value else print appropriate message
import java.util.*; public class Linear_Search { public static void main() { Scanner sc = new Scanner(System.in); int a[] = new int[10], i, pos=-1, s; System.out.println("Enter 10 values for the array:");…
- Programming
Write a program to input an array containing decimal point numbers and round them off to the nearest integer.
import java.util.*; public class Array_Round { public static void main() { Scanner sc = new Scanner(System.in); double n[] = new double[10]; int i, x; System.out.println("Enter 10 numbers with decimal points:");…
- Programming
Write a program to input a string and change the letters in upper case to lower case and vice versa.
import java.io.*; public class Case_Convert { public static void main()throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String s, s2=""; char ch; int i, l;…
- Programming
Write a Program to input a String and print the number of Alphabets, Vowels and Special Characters.
import java.util.*; public class Con_Vow { public static void main() { Scanner sc = new Scanner(System.in); String s; char ch; int a=0, v=0, i, l; System.out.println("Enter a string:"); s = sc.nextLine(); s =…
- Programming
Write a program to input a string and print the number of capital letters, small letters, digits and special characters in it.
import java.util.*; public class Count_Chars { public static void main() { Scanner sc = new Scanner(System.in); String s; char ch; int Cl=0, Sl=0, Dg=0, Sc=0, i, l; System.out.println("Enter a string:"); s =…
- Programming
Write a program to input a String and print the Number of Alphabets in it.
import java.util.*; public class Num_Alpha { public static void main() { Scanner sc = new Scanner(System.in); String s; char ch; int c=0, i, l; System.out.println("Enter a string:"); s = sc.nextLine(); l = s.length();…
- Programming
Write a program to print the Total Surface Area and Volume of a CUBE, CUBOID, CONE or SPHERE. According to user's choice
import java.util.*; public class Vol_Area_User_Ch { public static void main() { Scanner sc = new Scanner(System.in); int ch, s, l, b, h, r; double sh; System.out.println("Menu for Total Surface Area And Volume->");…
- Programming
Write a program in Java to input a character and print whether it is a digit or not. Using Switch case
This program uses the property of fall through in Switch Case import java.util.*; public class Digit_Switch { public static void main() { Scanner sc = new Scanner(System.in); char ch; System.out.println("Enter a…
- Programming
Write a program in Java to input two strings and print whether they are equal or not. Irrespective of their cases.
import java.util.*; public class String_Compare_Ignore_Case { public static void main() { Scanner sc = new Scanner(System.in); String s1, s2; int l1, l2, i, flag=1; System.out.println("Enter 2 strings:"); s1 =…
- Programming
Write a program in Java to input two strings and print whether they are exactly equal or not.
import java.util.*; public class String_Compare { public static void main() { Scanner sc = new Scanner(System.in); String s1, s2; int l1, l2, i, flag=1; System.out.println("Enter 2 strings:"); s1 = sc.nextLine(); s2 =…
- Programming
Write a program to demonstrate the joining of two strings using the concat() function
Description This method appends one String to the end of another. The method returns a String with the value of the String passed into the method, appended to the end of the String, used to invoke this method. Syntax…
- General
Selection Sort – Recursive Method Using Classes, Contructor and Functions
What is Recursion? Recursion is a programming technique that allows the programmer to express operations in terms of themselves. In Java, C, C++ and some more programming languages, this takes the form of a function…
- Programming
Write a program to input a number 'N' and print whether the number is Even or Odd. Use Ternary Operators
Normal Method [js theme=”” group=”” tab=”” highlight=””] public class even_odd { public static void main(int n) { if(n%2==0) //Checking if remainder is zero System.out.println(“The number is even”); else //else…
- Programming
Write a program to input a string and delete multiple spaces. Also delete the common words
import java.io.*; public class String_extract { public String dexspace(String s) { int i, l; char c1, c2;; String ns=""; s = s.trim()+' '; l = s.length(); for(i=0;i<l-1;i++) { c1 = s.charAt(i); c2 = s.charAt(i+1);…
- Programming
Write a program to input a number and print whether it is a Keith Number or not
A Keith number is an n-digit integer N>9 such that if a Fibonacci-like sequence (in which each term in the sequence is the sum of the n previous terms) is formed with the first n terms taken as the decimal digits of the…
- Programming
Write a program to input a number and check whether it is a Cyclic number or not
A cyclic number is a number of "n" digits that when multiplied by 1, 2, 3,...n, results in the same digits but in a different order. For example, the number 142,857 is a cyclic number since 142,857 x 2 = 285,714,…
- Programming
Write a program to input a number and check whether it is a Valid IMEI number or not
The International Mobile Station Equipment Identity or IMEI is a number, usually unique, to identify 3GPP (i.e., GSM, UMTS and LTE) and iDEN mobile phones. It is usually found printed inside the battery compartment of…
- Programming
Write a program to input a string and print the longest word and its length
<h3>Output</h3> Enter a string This is an example in Computer Application The length of the largest word "Application" is: 11 [js theme=”” group=”” tab=”” highlight=””] import java.io.*; class length_of_largest { public…
- Programming
Write a program to input a string array and sort it Alphabetically using Selection Sort technique
<h3>Output</h3> Enter the size of the array: 5 Enter the names: John Thomas Daniel Gabriel Arial The sorted array: Arial Daniel Gabriel John Thomas import java.io.*; public class String_Selection_Sort { public static…
- Programming
Wrtite a program to input a 2-Dimensional array and sort each row in ascending order
<h3>Output</h3> Enter the size of the array: 3 4 Enter the values for the array: 11 54 10 4 5 7 2 88 12 9 65 29 The array before sorting: 11 54 10 4 5 7 2 88 12 9 65 29 The Sorted array: 4 10 11 54 2 5 7 88 9 12 29 65…
- ISCProgramming
Kaprekar Number – ISC Practical 2010 – Question 2
A positive whole number ‘n’ that has ‘d’ number of digits is square and split into two pieces, a right – hand piece that has ‘d’ digits and a left- hand piece that has remaining ‘d’ or ‘d-1’ digits. If the sum of the…
- Programming
Write a program to input 2 numbers in Binary and add them.
In mathematics and digital electronics , a binary number is a number expressed in the binary numeral system or base-2 numeral system which represents numeric values using two different symbols 0 s and 1 s. 110100…
- Programming
Write a program to input an array of size 'N' and sort it using Insertion sort technique.
<h3>Output</h3> Enter the size: 7 Enter the elements: 32 12 554 23 25 16 76 Printing the elements: 12 16 23 25 32 76 554 import java.io.*; public class insertion_sort { static BufferedReader br=new BufferedReader(new…
- Programming
Write a program to input a matrix of size m by n and print the product obtained when multiplied by its transpose
Write a program to input a matrix of size m by n and print the product obtained when multiplied by its transpose <h2>Output</h2> Enter the number of rows: 2 Enter the number of columns: 3 Enter the values for the array:…
- Programming
Write a program that uses a recursive technique to sort an array using selection sort method
<h3>OUTPUT</h3> Enter the size of the array: 5 Enter the values for the array: 12 23 11 10 32 Array after selection sort: 32 23 12 11 10 import java.util.*; public class Selection_Recur { int largest(int a[], int i, int…
- Programming
Write a program to pass an array to a function and return the position of the largest value using recursive technique
<h3>OUTPUT</h3> Enter the size of the array: 5 Enter the values for the array: 21 12 23 11 15 The largest value is: 23 import java.util.*; public class Largest_Recur { int largest(int a[], int i, int maxp) {…
- Programming
Write a program to input a string and print each word in reverse.
Example Enter a string: This is an example OutPut:sihT si na elpmaxe import java.io.*; public class reverse_each_word { public static void main()throws IOException { BufferedReader r = new BufferedReader(new…
- Programming
Write a program to input two numbers x and y and print all prime triplets between these limits
Prime Triplets A prime triplet is a set of three prime numbers of the form (p, p + 2, p + 6) or (p, p + 4, p + 6) The first prime triplets are: (5, 7, 11), (7, 11, 13), (11, 13, 17), (13, 17, 19), (17, 19, 23), (37, 41,…
- Programming
Write a program to input an Array of size N and sort it using Bubble Sort Technique
import java.io.*; public class array_bubble { public static void main()throws IOException { BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); int a[], i, j, k, tmp, n; System.out.println("Enter…
- Programming
Write a program to input an array of size N and print the minimum value
import java.io.*; public class array_min { public static void main()throws IOException { BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); int n, a[], i, min; System.out.println("Enter the size of…
- Programming
Write a program to input an array of size N and print the maximum value
import java.io.*; public class max { public static void main()throws IOException { BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); int n, a[], i, max; System.out.println("Enter the size:"); n =…
- Programming
Write a program to input 2 arrays A and B of size M and N and merge them into a third array of size M+N
import java.io.*; public class Merge_Array { public static void main()throws IOException { BufferedReader r = new BufferedReader(new InputStreamReader(System.in)); int s1, s2; int a[], b[], c[], i;…
- Programming
Write a program to input a number and print it in words
Input: 7845746 Output: Seventy Eight Lakh Forty Five Thousand Seven Hundred and Forty Six [js theme=”” group=”” tab=”” highlight=””] import java.io.*; public class Num_2_Words { public String convert(int n) { String…