ISC Specimen Papers for Class 12 Computer Practical 2020 Solution | ISC Computer Practical Specimen 2020 Solved
Here is the ISC Computer Practical Specimen 2020 Solved Paper
Checkout:- Rotate Matrix 90 Degrees Clockwise | Clockwise Rotation Matrix
Checkout:- Symmetric Matrix Program In Java
We
are uploading these types of program. However, if you need fully
compiled solution of any type of Java program then simply leave a
comment below, we will help you at the earliest. 😊😊
import java.util.*;
public class Practical_Specimen_2020_Solution
{
public static void main()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter Number of Rows");
int r=sc.nextInt();
System.out.println("Enter Number of Columns");
int c=sc.nextInt();
System.out.println("Enter First character: ");
char A=sc.next().trim().charAt(0);
System.out.println("Enter Second character: ");
char B=sc.next().trim().charAt(0);
System.out.println("Enter Third character: ");
char C=sc.next().trim().charAt(0);
char arr[][]=new char[r][c];
System.out.println("Matrix:");
for(int i=0;i<r;i++)
{
for(int j=0;j<c;j++)
{
if((i==0 && j==0) ||(i==r-1 && j==r-1) || (i==0 && j==r-1) || (j==0 && i==r-1))
arr[i][j]=A;
else if((i==0 || i==r-1) ||(j==0 || j==r-1))
arr[i][j]=B;
else
arr[i][j]=C;
}
}
for(int i=0;i<r;i++)
{
for(int j=0;j<c;j++)
{
System.out.print(arr[i][j]+" ");
}
System.out.println("");
}
}
}
-------------
OUTPUT:-
-------------
Enter Number of Rows
4
Enter Number of Columns
4
Enter First character:
&
Enter Second character:
@
Enter Third character:
!
Matrix:
& @ @ &
@ ! ! @
@ ! ! @
& @ @ &
---------------------------
Checkout:- Find Transpose of a Matrix
Checkout:- Program to Find the Sum of Each Row and Each Column of Matrix
0 Comments
Just write down your question to get the answer...