What's new

Closed Pa help po

Status
Not open for further replies.

lemmor

Honorary Poster
Joined
Dec 28, 2011
Posts
632
Reaction
363
Points
235
Age
48
pano kayang gawing multiplication table ito me error kasi... patulong naman sa assignment ko..

#include <iostream.h>
#include<stdio.h>
#include<conio.h>
void main()

{ int a,b,d;
cout<<" M U L T I P L I C A T I O N T A B L E"<<endl;
cout<<"____________________________________________________"<<endl;

for(a=1;a<11;a++)


{ for(b=1;b<11;b++);


d=a*b;


cout<<d;

cout<<" ";

cout<<" "<<endl;}


getch(); }
 
good day.. try ko lang po ha :)
try mo po ilagay ang

instead
for(a=1;a<11;a++)


{ for(b=1;b<11;b++);

try this po
{for(a=1;a<11;a++)


for(b=1;b<11;b++);

not sure po but try that po..
 
ano po ba ang error mgs?

ah running sya? anu po ba ang nakalagay pag ng input kana?

ah running sya? anu po ba ang nakalagay pag ng input kana?
 
tatlong number 121 dapat ang output nito ay iyong literal na multiplication table..

wala po bang makaka solve sa c++ problem ko?
 
wala bang me makaka tulong sa akin....pls help po umaga na wala pa ring nangyayari..
 
anong gusto mong output?

1 * 1 = 1
1 * 2 = 2

or ganto

1 2 3 4 5 6 7 8 9 10
2 4 6 8 10 12 14 16 18 20
3 6 9 12 15 18 21 24 27 30
 
Ka phc mali po ang gamit mo ng curly brace. Tapos pre int main gamitin mo
Tapos ganto ung header
#include<iostream>
using namspace std;
//pag c++ yan ang gamit pre
 
Ka phc mali po ang gamit mo ng curly brace. Tapos pre int main gamitin mo
Tapos ganto ung header
#include<iostream>
using namespace std;
//pag c++ yan ang gamit pre

Eto pre turo ko sayo. Bka importante sana makatulong
#include <iostream>
using namespace std;

//initialize agad para malinis tignan ung code
int main(){
int row,column,table,num;
/*ung num pre para kung ilang table gusto mo kunwari hanggang table of 5 lang*/
cout<<"Enter the number of table: ";
cin>>num;
cout<<endl;
for(column=1;column<=num;column++){
for(row=1;row<=num;row++)
{
table=row*column;
cout<<table <<" \t";
}
}
return 0;
}
/*codeblocks mo irun pre pero pag turbo c walang namespace std; tapos ung include mo <iostream.h> un lng pre tapos wag void main int main pre*/
 
Last edited:
ano bang studio ang gamit mo?
try mo ito pang old version ng cpp
Code:
#include<iostream.h>;
#include<conio.h>;
#include<stdio.h>;

int main(){
      int multiplicand,multiplier,product;
 
      for(multiplier=1;multiplier<=10;multiplier++){
          for(multiplicand=1;multiplicand<=10;multiplicand++){
             product=multiplicand*multiplier;
              cout<<multiplicand<<" x "<<multiplier<<" = "<<product<<"\t";
          }
         cout<<endl;
      }
   getch();
   return 0;
}
eto pang new ng cpp
Code:
#include<iostream>;
#include<conio.h>;

using namespace std;

int main(){
int multiplicand,multiplier,product;
 
      for(multiplier=1;multiplier<=10;multiplier++){
          for(multiplicand=1;multiplicand<=10;multiplicand++){
             product=multiplicand*multiplier;
              cout<<multiplicand<<" x "<<multiplier<<" = "<<product<<"\t";
          }
         cout<<endl;
      }
   getch();
   return 0;
}
}
Ito ang sample output
You do not have permission to view the full content of this post. Log in or register now.
sabihin mo lang tol kung may error .

Salamat..I do hope na nakatulong
Note: Wag mo lang po sana copyahin analyze the flow ng program.
 
Last edited:
pano nga po ba intindihin ang pag gamit ng loop iyong mga curly braces nkakaintindi naman ako ang prob lang e ang pag initiate ng mga curly braces dito ako nag kaka roon ng confusion.

1 2 3 4 5 6 7 8 9 10
2 4 6 8 10 12 14 16 18 20
3 6 9 12 15 18 21 24 27 30


ganitong output sana lalabas pano nga ba ang pag intindi ng curly braces?
 
Subukan mo muna ang nasa taas na code po...

ang curly braces po ay nag de-determine ng scope ng function ang sa tanong mo ay loop, wag mo gamitin ang termination ay semi-colon
example yung ginawa mo sa taas
eto for(b=1;b<11;b++); eto po ay considered as invalid

ang tama po ay
for(initialization;condition;inc/dec){
//block of statement
}


kahit na mag nested loop ka kailangan mo paring sunding ang basic rule ng function....
 
Last edited:
nainintindihan ko na ... kung sa if statement pano ba ang proper at pahabol sir
sir pano ba gawing pseudocode ito into statement form.. salamat uli..
 
If statement or conditional statement ini evaluate nito ang condition whether true or false. If true ang condition inie execute ang statement otherwise walang execution.
Syntax:
If(condition){
Statement
}
Kahit na mag nested if ka same structure parin ang if statement
Ang pseudoce nmn binigay ko na sayo ang code kaw nalng gumawa...read this link para mas maintindihan pa ang pseudocode You do not have permission to view the full content of this post. Log in or register now.
 
C#

#include<stdio.h>
#include<conio.h>

void main()

{
int a,b;
clrscr();
for(a=1;a<=12;a++)
{
for(b=1;b<=10;b++)
{
printf("%d\t",a*b);
}
printf("\n");
}
getch();
}

___________________________________________________________________
c++

#include<iostream.h>
#include<conio.h>

void main()

{
int a,b;
clrscr();
for(a=1;a<=12;a++)
{
for(b=1;b<=10;b++)
{
cout<<a*b<<"\t";
}
cout<<"\n";
}
getch();
}

Subokan mo to pre :)
 
Status
Not open for further replies.

Similar threads

Back
Top