Jump to content
zovy52

Limbaj

Recommended Posts

Posted (edited)

Dau un exemplu:

var i = 0;
while ( i < 2 ) {
print( "i is now " + i );
i++;
}

var times = 2;
while (times < 2 ) {
print( "hello" );
times
};

Ce limbaj este acesta? C++?

Edited by zovy52
Posted (edited)

@user3.14159265 daca era python acel cod ar fi fost de forma :

times = 2

while times < 2 :

print "hello"

al doilea code snipet aduce putin cu java .

Edited by BGS
Posted (edited)

@zovy52 Tu ai combinat 2-3 limbaje si incerci sa ne testezi inteligenta?:D C++ nu poate fi din moment ce e declaratia cu "var" acolo, declaratie specifica pascal/delphi. Insa nici pascal/delphi nu poate fi.

Edited by skull
Posted (edited)

Scuzati de intarziere, eram la scoala.

Just as a for loop, could let you do things more than once, a while loop lets you do the same thing.

Similar to the for loop, the while loop requires a condition that will be evaluated every iteration through the loop. If the condition evaluates to true, the code inside the loop in executed. Check out the example here to see what happens.

Exercitiul il am de aici : While You Wait - Getting Started with Programming | Codecademy

Din cate vad eu, nu prea e nimeni sigur pe el deci probabil e doar ceva de acomodare cu limbajele...

@ Nytro, arata de 2 ori hello...

Edited by zovy52
Posted

E C# cu functie implementata in corpul sursei :) sau un actionscript dar nu stiu daca merge fara sa specifici tipul de date stiu ca era var i:int de exemplu. Plm poate fi orice limbaj, s-a mai zis depinde de toata sursa.

Nu vad, care e rostul intrebarii ?

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.



×
×
  • Create New...