.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> OOPS >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Java program to upper matrix

Posted By:laptop charles       Posted Date: June 30, 2010    Points: 10    Category: OOPS    URL: http://www.dotnetspark.com  

Upper matrix
 

To calculate the sum of upper matrix.
import java.io.*;
class UpperMatrix
{
	public static void main(String ar[])throws IOException
	{
		int i,j,sum=0,k=0;
		int a[][]=new int[3][3];	
		BufferedReader n=new BufferedReader(new InputStreamReader(System.in));
		System.out.println("Enter 3*3 Matrix");
		for(i=0;i<3;i++)
		{
		    for(j=0;j<3;j++)
		    {
		          a[i][j]=Integer.parseInt(n.readLine());
		     }
		}
		System.out.println("");
		for(i=0;i<3;i++)
		{
		    for(j=0;j<3;j++)
		    {
		        System.out.print(a[i][j]);
		     }
		      System.out.println("");
		}

		for(i=0;i<3;i++)
		{
		    for(j=0;j<3;j++)
		    {
		          if(i

     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend