මේ එකක් තාම හදනව!!
අද දානව![]()
Elaz Same here But matanam adama sure naha .try karanwa !!! ada ambanta wena wada !!!!

මේ එකක් තාම හදනව!!
අද දානව![]()

#include <cstdlib>
#include <iostream>
#include <windows.h>
#include <math.h>
using namespace std;
void gotoxy(int x, int y)
{
COORD coord;
coord.X = x;
coord.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}
float round(float n,int place)// taken from http://forums.devshed.com/c-programming-42/round-up-a-decimal-number-in-c-69908.html
{
float d;
int i;
/* rescale 123.45678 to 12345.678 */
d = n * pow(10,place);
/* round off: 12345.678 + 0.5 = 12346.178 -> 12346 */
i = d + 0.5;
/* restore to its original scale: 12346 -> 123.46 */
d = (float)i / pow(10,place);
return d;
}
int DrawLine(COORD p1,COORD p2)
{
int i,j,w,h,iStart,iEnd;
short k,l;
//p1 should be on the left of p2
if (p1.X>p2.X){
k=p2.X;
l=p2.Y;
p2.X=p1.X;
p2.Y=p1.Y;
p1.X=k;
p1.Y=l;
}
double c,r;
h=abs(p1.Y-p2.Y);
w=abs(p1.X-p2.X);
iStart=p1.X; //set all to defaults
iEnd=0;
gotoxy(0,0);
if ((h==0) || (w==0))
{
if (h==0) {
for (i=0;i<=w;i++){
gotoxy(i+p1.X,p1.Y);
cout<<"*";
}
goto end;
}
if (w==0) {
if (p1.Y>p2.Y){
for (j=0;j<=h;j++){
gotoxy(p1.X,p1.Y-j);
cout<<"*";
}
goto end;
}
else
{
for (j=0;j<=h;j++){
gotoxy(p1.X,p1.Y+j);
cout<<"*";
}
goto end;
}
}
}
else
{
r=h%w;
r=r/w;
c=round(h/w,0);
if (p1.Y>p2.Y){
for (i=0;i<=w;i++){
iStart=iEnd;
iEnd=-(int)(c*(i+1) + r*i);
if (i==w){
iStart=iEnd;
iEnd=h;
}
for (j=iStart;j>=iEnd;j--){
gotoxy(i+p1.X,j+p1.Y);
cout<<"*";
}
}
}
else
{
for (i=0;i<=w;i++){
iStart=iEnd;
iEnd=(int)(c*(i+1) + r*i);
if (i==w){
iStart=iEnd;
iEnd=h;
}
for (j=iStart;j<=iEnd;j++){
gotoxy(i+p1.X,j+p1.Y);
cout<<"*";
}
}
}
}
end:
return 0;
}
main()
{
int t;
COORD p1,p2,p3;
t=1;
cout<<"Enter 1st point : ";
cin>>p1.X>>p1.Y;
system("CLS");
p3=p1;
while (t=1){
gotoxy(0,0);
cout<<" ";
gotoxy(0,0);
cout<<"("<<p3.X<<","<<p3.Y<<")"<<"Enter next point : ";
cin>>p2.X>>p2.Y;
p3=p2;
DrawLine(p1,p2);
p1=p3;
}
}



Test Case, you can change these accordingly
C = |12| * |256|
|34| |563|
A = |12|
|34|
B = |256|
|563|
r = A's row count
c = A's and B's column count
d = B's column count
C will contain the resulting matrix.
#include <stdio.h>
#include <conio.h>
int main()
{
int r,c,d,x,y,i;
r=2;
c=2;
d=3;
float A[r][c], B[c][d], C[r][d],D;
A[0][0]=1;
A[0][1]=2;
A[1][0]=3;
A[1][1]=4;
B[0][0]=2;
B[0][1]=5;
B[0][2]=6;
B[1][0]=5;
B[1][1]=6;
B[1][2]=3;
for (y=0;y<r;y++){
for (x=0;x<d;x++){
D=0;
for (i=0;i<c;i++){
D=D+A[y][i]*B[i][x];
}
C[y][x]=D;
printf("%f ",C[y][x]);
}
printf("\n");
}
getch();
return 0;
}
ela ela![]()
2D array walata pin sidda wenna![]()




ee mokadda ee2D array ම ඕන නෑ හැබැයි මේ ක්රමය ලේසි, record type එකකින් කරන්නත් තිබ්බ![]()

mama danne nee 

mara cn eka meee
1 pharmcay ekaka access podi magulak dala tiyanawa
eeke hadaopu ekata podi deyak amataka wela![]()
den pharmacy ekata aluthen stock gattama price wenas ne
bt ee item ekeee price eka wenas karanna beeene mokada parana price ekee stock tawa itiri wela tiyanawanee so ee wage welawal walata mokada karanna honda![]()
ITEM_CODE ITEM_NAME PRICE_OF_ONE_UNIT UNIT_TYPE
00164 Panadol Box 50 BOX
00165 New Panadol Box 52 BOX
