?

[12 2008] [10 ]

, . Java, HTML, CSS -C, . , .

(indentation) - : ""

, . , . if . while .

. Where am I :

while (x<100){
cout << "I am lost !" << endl;
if (i=0){
x++
cout << "Where am I ?" << endl;
i=50
}
i--;
}
cout << "Can you tell me where I am ?" << endl;

, . -if -while:

while (x<100){
        cout << "I am lost !" << endl;
        if (i=0){
                x++
                cout << "Where am I ?" << endl;
                i=50
        }
        i--;
}
cout << "Can you tell me where I am ?" << endl;

(Comments)

. . /* -*/ . // . , , "" .

:

int x, y;
cin >> x;
cin >> y;
int c=0;
for (int i=0; i<y; i++){
                c+=x;
}
cout << "c";

, :

/*
-----------------------------------------
The next few lines multiplies two numbers
-----------------------------------------
*/
int x, y;
/* Read two numbers from the console */
cin >> x;
cin >> y;
int c=0;  // c will hold the result, initialize it to zero
/* calculate (x*y) */
for (int i=0; i<y; i++){
                c+=x;
}
/* Output the result to the console */
cout << c;

.

( x*y), . ( ) ( ).

, . - , - ? ?

. x multiplicand (), -y multiplier () -c result () :

/*
-----------------------------------------
The next few lines multiplies two numbers
-----------------------------------------
*/
int multiplicand, multiplier;
/* Read two numbers from the console */
cin >> multiplicand;
cin >> multiplier;
int result=0;
/* calculate (multiplicand*multiplier) */
for (int i=0; i<multiplier; i++){
                result+=multiplicand;
}
/* Output the result to the console */
cout << result;

" ", , c result - "".

{} . (class), , while -for . :

if (x==0)
        cout << "All Good" << endl;

, . x , All Good . {} -if .

, , . -if :

if (x==0)
        x=1;
        cout << "All Good" << endl;

x -0 - -if, -if All Good . x -0, , All Good () .

, :

if (x==0)
{
        cout << "All Good" << endl;
}
. , - -if - .

" " "-". , .

void get_numbers(int *number_1, int *number_2){
        cin >> *number_1;
        cin >> *number_2;
}
int multiply(int multiplicand, int multiplier){
        int result=0;
        /* calculate (multiplicand*multiplier) */
        for (int i=0; i<multiplier; i++){
                result+=multiplicand;
        return result;
}
void display_result(int result){
        cout << "The correct answer is: " << result << endl;
}

int main(){
        int number_1, number_2;        

        // Get two numbers from the user
        get_numbers(&number_1, &number_2);

        // Multiply the numbers
        int result = multiply(number_1, number_2);
        
        // Output the answer
        display_result(result);
}

-main . , . , display_result.

=

, . . : !

, . :
( . )

10

  1. Itay Alon | 7/12/2008 8:26:25 AM

    , ( -PHP ).

    , .

  2. | 7/12/2008 11:43:55 AM

    , . . , .

      ,     .

    , ,   .

  3. | 7/24/2008 5:50:58 AM

     
    .
    -OO  
    . ,
    , .
    :
    1. ,
      ,
    .
    2.   -
    .  :
    , ,  ,
    , ,  
    ....     
    , .
    , , . 

  4. | 7/24/2008 10:24:05 AM

    , . ,   OOP -   , , .

  5. | 12/30/2009 12:36:11 PM

     

    ....  

    . (XP, Agile, Scrum) .

    , " , ( ) .

     

    Clean Code :)

  6. | 12/30/2009 3:02:59 PM

    , :

    //if dummy is true send a message

    if (dummy==false) send_message

    , .

    , . :

    //Notify the user about the failure

    , , -GUI .

    ?

    , , . .

  7. | 2/25/2013 10:54:03 AM

    , .
    , .
    -.  

  8. | 9/25/2014 3:01:19 PM

    . (pun unintended) .

    . , :

    - ,   " . , .

    -   . , ( '' ), ' ' . .

    . self-explanatory ( : - , , '), . , , .

    , beneficial . , .

    , .

     

  9. MyCityDex | 4/19/2017 7:08:09 AM
    . 100 000 . ? ? ? , [url=http://predstavitel-vstrecha.ru/index.html]21 , 19:30, : . , , 7.[/url] [URL=http://predstavitel-vstrecha.ru/][IMG]http://funkyimg.com/i/2rVxt.jpg[/IMG][/URL]
  10. Vernontus | 4/25/2017 1:39:34 PM
    http://clkme.in/qIgLcG http://clkme.in/qIgLcG http://clkme.in/qIgLcG http://clkme.in/qIgLcG http://clkme.in/qIgLcG http://clkme.in/qIgLcG