473,396 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

I have code how to print identity matrix but i want it to multiply by character L

12
Expand|Select|Wrap|Line Numbers
  1. identity = new int[SS, SS];
  2.             for (int row = 0; row < SS; row++)
  3.             {
  4.                 for (int col = 0; col < SS; col++)
  5.                 {
  6.                     identity[row, col] = (row == col) ? 1 : 0;
  7.                     Response.Write(identity[row, col] + " ");
  8.                 }
  9.                 Response.Write("<br/>");
  10.             }
  11.  
the above code displays output suppose consider 3 x 3 matrix
it prints identity matrix as
1 0 0
0 1 0
0 0 1

i want to multiply it by L character so that the output must be
L 0 0
0 L 0
0 0 L

i have tried no.of ways but it is printing ASCII number of alphabet please help........
Jun 1 '10 #1
1 2721
Christian Binder
218 Expert 100+
Just mutiply the matrix' value by L.
L is int, 76 would be the ASCII number for 'L'
Or use Convert.ToInt32('L')

And when printing, convert value back to char by using Convert.ToChar(intValue);
Jun 2 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

58
by: Jeff_Relf | last post by:
Hi Tom, You showed: << private const string PHONE_LIST = "495.1000__424.1111___(206)564-5555_1.800.325.3333"; static void Main( string args ) { foreach (string phoneNumber in Regex.Split...
9
by: Steven T. Hatton | last post by:
The following works: template <typename T> struct ID3M{ static const T ID; }; template <typename T> const T ID3M<T>::ID = {{1,0,0},{0,1,0},{0,0,1}};
3
by: Josh | last post by:
Howdy i was recently given a program to do. I have to create a 2d matrix with pointers i have the whole idea down with pointers but there is a problem with one of them i have the code written down...
4
by: eewwttww | last post by:
how to save with only WebBrowser: save html+picture without dialog box? what I Have is: WebBrowser.ExecWB OLECMDID_SAVEAS, OLECMDEXECOPT_PROMPTUSER, 300, 300 I don't want this code. I want...
5
by: eewwttww | last post by:
how to show the html code that the WebBrowser want to save when he want to save html+pictures with the "dialogbox" - before saving. this is the code to open the save "dialogbox" ...
2
by: candexis | last post by:
Hi!!!!!!!, well i want to know how to print in screen a matrix like this: Matrix = {{1,2,3,4},{5,6,7,8},{9,10,11,12},{13,14,15,16}}; And the output must be like this: 1 2 3 4 5 6 7 8 9...
8
by: jeffpierce12 | last post by:
Hello, I am trying to send some characters to a scanner that I have hooked up to the COM 1 port on my PC. I am running Linux operating system, and I have the following sample program: ...
1
by: td0g03 | last post by:
This is the code I have so far. I want it to print it in different order like you can probably see below. But when I actually see the results it gives me different numbers. It gives me this after I...
1
by: chriswilliams | last post by:
This code prints output in rows like this: ****** ****** ****** How to make print in blocks like this? ***** ***** ****** ***** ***** ****** ***** ***** ***** start= int...
0
by: vj4u | last post by:
int ss = 4; int count = 0; int matrix=new int; ArrayList al = new ArrayList() {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16 }; for (int i = 0; i < ss; i++) { ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.