Skip to main content

Posts

ISC 2018 Practical Examination Question- 1 🔥🔥🔥

PROGRAM:  GOLDBACH  NUMBER Question Courtesy: ISC BOARD 2018 PRACTICAL PAPER CODE: 🔥🔥🔥 OUTPUT:
Recent posts

Two Dimensional Array Sorting: By User Selected Column

SORTING A TWO DIMENSIONAL ARRAY COLUMN WISE AIM:      Take a Two Dimensional array. Each row corresponds to a student and columns correspondingly represents the Roll Number. Marks in English ,Marks in Math and Marks in Hindi. Take all the inputs from the user. Provide a choice to the user of sorting this two dimensional array on the basis of any of the four columns, i.e., sorting can be done on Roll. no. or any of the three marks.In case more than  one student has scored same marks then the lashing is resolved using Roll. no. For Example: Input :                     By  Column 1:         By Column 2: 2 50 60 40               1 50 40 30               4 20 60 60 1 50 40 30               2 50 60 40               3 40 50 40  4 20 60 60               3 40 50 40               1 50 40 30 3 40 50 40               4 20 60 60               2 50 60 40 CODE:

ISC 2018 Practical Question: 3

ISC 2018 Q.03 SYNTAX

Pattern: Inverse Pyramid Of Stars

Pattern: Inverse Pyramid Aim:    TO Print An Inverse Pyramid of Stars Using JAVA.  Get the User Input of No. of Stars and Print Following pattern. Output:  6  * * * * * *   * * * * *    * * * *     * * *      * *       * Syntax:    import java. util .*; class pyramid_inverse {     public static void main(String args[])     {         int n;         Scanner scanner=new Scanner(System.in);         System.out.println(" Enter A Number ");         n=scanner.nextInt();         for(int i=1;i<=n;i++)         {             for(int j=1;j<i;j++)             {                 System.out.print(" ");             }             for(int k=n;k>=i;k--)              {             System.out.print(" * ");                 }             System.out.println();     } } }

PATTERN: ARROW

PROGRAM: ARROW PATTERN AIM: TO PRINT THE ARROW PATTERN SUCH AS 1 1 2 1 2 3 1 2 3 4 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1 SYNTAX: import java.io.*; class pattern_arrow {     public static void main(String args[])throws IOException     {         BufferedReader br=new BufferedReader(new InputStreamReader(System.in));         System.out.println("ENTER A NUMBER");         int n=Integer.parseInt(br.readLine());         for(int i=1;i<=n;i++)         {             for(int j=1;j<=i;j++)             {                 System.out.print(j+" ");             }             System.out.println();         }         for(int i=n-1;i>=1;i--)         {             for(int j=1;j<=i;j++)             {              System.out.print(j+" ");             }             System.out.println();         }     } } OUTPUT:         

PYRAMID SHAPE: USING FUNCTION CALLING

PYRAMID SHAPE: USING FUNCTION CALLING ANOTHER FUNCTION AIM:   TO PRINT THE PYRAMIDAL SHAPE USING LOOP CONCEPT AND PRINTING NUMBERS EXAMPLE:                 1              2 3            4 5 6           7 8 9 10 SYNTAX import java.io.*; class pattern2 {     public static void main(String args[])throws IOException     {         BufferedReader br=new BufferedReader(new InputStreamReader(System.in));         System.out.println("Enter No. of lines to print");         int n= Integer.parseInt(br.readLine());         int x=1;         int l=n-1;         for(int i=1;i<=n;i++)         { spaces(l--);             for(int j=1;j<=i;j++)             {System.out.print(x+" ");                 x++;             }             System.out.println();         }              }     public static void spaces(int x)     {         for(int i=1;i<=x;i++)         {             System.out.print(" ");        

Anagram Strings

PROGRAM: ANAGRAM STRINGS Two strings are anagram if they are written using same exact letters,ignoring space, punctuation and capitalization. Each letter should have the same count in both strings. For Example: Mary and Army are anagram of each other. SYNTAX: import java.io.*; class anagram {     public static void main(String args[])throws IOException     {         BufferedReader br=new BufferedReader(new InputStreamReader(System.in));         System.out.println("Enter Two Strings to check whether they are anagram or not");         String s1=br.readLine();         String s2=br.readLine();         String nstr="",ntr="";int count=0;         for(int i=0;i less than s1 length;i++)         {             if(Character.isLetter(s1.charAt(i)))             {                 nstr+=s1.charAt(i);             }         }         for(int i=0;i  less than s2 length;i++)         {             if(Character.isLetter(s2.charAt(i)))