Jump to content
Sign in to follow this  
putra

Operan Ke Operator ?

Recommended Posts

smile.gif

Ok...

Nak mintak tolong kat sesaper yg tau... n sudi nak bagi tau...

Ni contoh aturcara

//mula

if ( i == 1 )

{

A = 2;

}

else

B = 3;

//tamat aturcara sempoi

ok, persoalan nya aku nak buat satu aturcara yg boleh kira jumlah operan dan operator dalam aturcara seperti kat atas tu..

Contohnya,

operan --> <i> , <1> , <A> , <2 >, <B>, <3>

operator --> <if - else> , <==>

Masalah nye, ade x commmand dlm java yg boleh detect if-else tu sebagai satu operand..

Share this post


Link to post
Share on other sites

ini bukanke dah masuk dalam nk buat compiler? ermm.... kalo betul, aku tgh belajar wat mende nih.... aku pun kabur2 je pasal nih. cube kite tengok pendapat orang yang dah belaja, ingatke tak lagi smile.gif

Share this post


Link to post
Share on other sites

erk... ada post ke dua yang sama ke? sorry tak perasan. Nak kira berapa kali if / else / == dah digunakan? Aku rasa mustahil sebab biasanya nak kira-kira nie. Memerlukan input daripada User. *rasanya* cool.gif

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...