Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

help c++ arrays

.mixc

Recruit
Basic Member
Messages
5
Reaction score
0
Points
16
help po, pwedeng pagawa po ng program using arrays po
ito po sample



=====================================
Enter value for row [3-9] : 3
Enter value for column [3-9] : 3
0 1 2 3
1 1 2 3
2 2 4 6
3 3 6 9



Sample OUTPUT 2:

Enter value for row [3-9] : 7
Enter value for column [3-9] : 3
0 1 2 3
1 1 2 3
2 2 4 6
3 3 6 9
4 4 8 12
5 5 10 15
6 6 12 18
7 7 14 21

Include validations for wrong input.
 
help po load ko n lang po nka gawa pls
 
parang:

Code:
cout>>"Enter value 1: ";
cin<<value1;
cout>>"Enter value 2: ";
cin<<value2;

for (int x = 0; x <= value1; x++) {
for (int y = 0; y <= value2; y++) {
cout<<x * y<<" ";
}
cout<<"\n";
}


yan lang hinihingi mo di ba? try mo. di array yan. Di mo need nun. :)

kung mag array ka, ibang usapan naman yan...
 
Last edited:
gulo ng output mo.
3x3 ung row column tapos nakalagay 4x4
 
Baka ibig sbhn n 0t0r mg papainput ng # ng row pti col..tp0z ang output ay mgsisimula sa 1...n..ganyan b 0t0r.
 
gulo ng output mo.
3x3 ung row column tapos nakalagay 4x4

> may point si kuya..
ung output nya naging 4x4 instead na 3x3
0 1 2 lng dapat' :)
1 1 2
2 2 4

anyway..

#include <iostream>
#include "conio.h"
using namespace std;

void main()
{
int col, row, data[2][9],i;
int c=0; int d=0;

cout << "Enter value for row [3-9] :"; cin >> row;
cout << "Enter value for column [3-9] :"; cin >> col;

for (i=0;i<row;i++)
{
data[0]=i;
cout << data[0] << " ";
}
cout << endl;


for (i=0;i<col-1;i++)
{
d=i+1;
data[1] = d;

cout << data[1] << " ";
for (c=0;c<row-1;c++)
{
cout << data[1] * data[0][c+1] << " ";
}
cout << endl;
}

_getch();
}


this is a personal program... haven't simplified it yet but it works :)

Output:
Enter value for row [3-9] : 4
Enter value for column [3-9] : 4
0 1 2 3
1 1 2 3
2 2 4 6
3 3 6 9
 
lol// multiplication table.. almost 1 year bago may sumagot.. haha
 
> may point si kuya..
ung output nya naging 4x4 instead na 3x3
0 1 2 lng dapat' :)
1 1 2
2 2 4

anyway..

#include <iostream>
#include "conio.h"
using namespace std;

void main()
{
int col, row, data[2][9],i;
int c=0; int d=0;

cout << "Enter value for row [3-9] :"; cin >> row;
cout << "Enter value for column [3-9] :"; cin >> col;

for (i=0;i<row;i++)
{
data[0]=i;
cout << data[0] << " ";
}
cout << endl;


for (i=0;i<col-1;i++)
{
d=i+1;
data[1] = d;

cout << data[1] << " ";
for (c=0;c<row-1;c++)
{
cout << data[1] * data[0][c+1] << " ";
}
cout << endl;
}

_getch();
}


this is a personal program... haven't simplified it yet but it works :)

Output:
Enter value for row [3-9] : 4
Enter value for column [3-9] : 4
0 1 2 3
1 1 2 3
2 2 4 6
3 3 6 9



Sir pwde pa bang magamit ang "getch()" sa Visual studio 2010 or newer version?
 
Sir pwde pa bang magamit ang "getch()" sa Visual studio 2010 or newer version?

sir just use the logic wag po tayo copy paste lang. disregard niyo na lang yung ndi nman kailangan.
:rofl:
 
Back
Top Bottom