Navbar

Thursday, 2 April 2020

ISC COMPUTER PRACTICAL - 2020 - QUESTION 2 (Matrix Program)

ISC 2020 Computer Practical Question 2–Matrix program.

-WRITTEN BY CODERGURUJI









Solutions:


 import java.util.*;
class coderguruji
{
public static void main(String args[])
{
double d=0.0;
Scanner sc=new Scanner(System.in);
System.out.println("enter m*n");
int p=0,q=0,x=0,s=0,y=1;
int m=sc.nextInt();
int n=sc.nextInt();
if((m<0||m>10)&&(n<2||n>6))
{
System.out.println("OUT OF RANGE");
}
else
{
int a[][]=new int[m][n];
int b[]=new int[1000];
int c[]=new int[1000];
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
{
a[i][j]=sc.nextInt();
}
}
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
{
b[p]=a[i][j];
p++;
}
}
for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
{
d=a[i][j]*Math.pow(8,n-y);
s=(int)d;
x=x+s;
y++;
}
c[q]=x;
q++;
y=1;
x=0;
}
System.out.println("FILLED MATRIX"+"\t\t"+"DECIMAL EQU");

for(int i=0;i<m;i++)
{
for(int j=0;j<n;j++)
{
System.out.print(a[i][j]+" ");
}
System.out.println();
}
for(int j=0;j<q;j++)
{
System.out.print("\t\t\t"+c[j]);
System.out.println();
}
}
}
}
---------------------------end-------------------------------

7 comments:

  1. Sir, I need Question 3 solution. When will uou post it ??

    ReplyDelete
    Replies
    1. very soon!!
      And kindly share it with your friends.

      Delete
  2. "Ziyyara’s ISC tutor offers one-to-one online home tuition for ISC Board students.They implement pedagogy teaching methods while delivering online tuition classes."
    Visit On:- isc online tuition
    Phone no - +91-9654271931

    ReplyDelete
  3. Thanks For sharing this wonderful blog.
    Ziyyara is a platform which provides isc class 12 online classes. And tuition for ISC classes or call +91-9654271931 for more information.

    ReplyDelete
  4. Are you looking for ISC Online Tuition Classes for your children so that they can get ahead in their studies? Ziyyara is an online learning platform that provides one-on-one Online Tuition For ISC Board for all grade students worldwide.
    Contact Us: India - +91-9654279131 | UAE - +971-585346679 | Oman - +968 71912179

    ReplyDelete