🔒 Closed Pa help naman po about sa increment

Status
Not open for further replies.
Baka ganyan tinutukoy na multiplication by 7
dito ka lang po mismo mag cocode
or mag gawa ng multiplication table
for (int x=0 ; x <= 100 ; x++)

nag try po ako mag lagay ng asterisk na sign sa x++ yung x++ pinalitan ko ng x** kaso error siya e
so
eto ginawa namin
for (int x=0 ; x <= 98 ; x+=7)
sa multiplie po yan sir
 
Baka ganyan tinutukoy na multiplication by 7
dito ka lang po mismo mag cocode
or mag gawa ng multiplication table
for (int x=0 ; x <= 100 ; x++)

nag try po ako mag lagay ng asterisk na sign sa x++ yung x++ pinalitan ko ng x** kaso error siya e
so
eto ginawa namin
for (int x=0 ; x <= 98 ; x+=7)
sa multiplie po yan sir

hahaha

ganito kasi yan

initial value from declaration of X is 1
condition x<=10: meaning nito is mag stostop ang loop hanggang ang value ni x ay 11
x++ naman is same as this x = x + 1
ang tawag diyan postincrement
ahh post increment pala yun
 
dito ka lang po mismo mag cocode
or mag gawa ng multiplication table
for (int x=0 ; x <= 100 ; x++)

nag try po ako mag lagay ng asterisk na sign sa x++ yung x++ pinalitan ko ng x** kaso error siya e
so
eto ginawa namin
for (int x=0 ; x <= 98 ; x+=7)
sa multiplie po yan sir
hahaha
mali talaga yan. wala x**. ganito yan x*=7
 
dito ka lang po mismo mag cocode
or mag gawa ng multiplication table
for (int x=0 ; x <= 100 ; x++)

nag try po ako mag lagay ng asterisk na sign sa x++ yung x++ pinalitan ko ng x** kaso error siya e
so
eto ginawa namin
for (int x=0 ; x <= 98 ; x+=7)
sa multiplie po yan sir
Ahh bale sa for loop lang po magmomodify
 
Kung gagawa ka po ng multiplication table bale ganito po yun sa java

ex.

Scanner input = new Scanner(System.in);
System.out.print("Enter Numbers ");

int n = input.nextInt();

for(int i = 1; i <= 10; i++)
System.out.println(n+" * "+i+" = "+n*i);

Sample nag input ako ng 1 bale ang output na po ay ganito.

Enter Numbers 1
1 * 1 = 1
1 * 2 = 2
1 * 3 = 3
1 * 4 = 4
1 * 5 = 5
1 * 6 = 6
1 * 7 = 7
1 * 8 = 8
1 * 9 = 9
1 * 10 = 10

sana po makatulong. Godbless.

sir c++ language na ginagamit namin dito. java yan. but thanks for sharing
 
sir c++ language na ginagamit namin dito. java yan. but thanks for sharing
Mag kapareho lang po yan kaso iba ang syntax ng pang print sa c++ pero yung for() is the same bale ang gawin mo miss gawa ka muna ng input tapus forloop saka ka mag saka mag print saka yung i++; po hindi po binabago yan kasi ibig sabihin nyan increment bale kunwari yung i naten my value na 1 ngayon i++ ganito mang yayari 1+1 = 2 kaya sa susunod ng print ang ilalabas ay 2 hangang ma meet nya yung condition ng forloop.
 
Status
Not open for further replies.

About this Thread

  • 158
    Replies
  • 7K
    Views
  • 30
    Participants
Last reply from:
Jmrie_

Trending Topics

Online now

Members online
433
Guests online
1,105
Total visitors
1,538

Forum statistics

Threads
2,273,075
Posts
28,947,433
Members
1,236,589
Latest member
masterpogi24
Back
Top