Page 2 of 2 FirstFirst 12
Results 11 to 18 of 18
  1. #11

    Quote Originally Posted by unfamous View Post
    hehe ahw sorry bag.o pa gyud tawn ko human ani na course. Mao fresh pa hehe, next course advance programming na heheh.
    nyc thing is nakacreate ka own ur own nga program kay naa mn uban ask help daun dn nhan sd code jud pg run nlng kulang... hehe atleast kw u learn from ur mistake ron... gudluck sa programming... hehe

  2. #12
    Your Code:
    Code:
    #include <stdio.h>
    #include <conio.h>
    int multiply( int x, int y )
     {
     int product;
     product = x * y;
     return product;
     }
    int main()
    
     {
     clrscr();
     int ans;
    /*
     This is not logically correct, you have to declare all variables before you
     use any program statement or a built-in function.
    */
     ans = multiply(5, 2);
     printf("The product of 5 and 2 is %d", ans);
     return 0;
     getch(); 
    /*
     This is not reachable anymore because you already returned the program control to the OS
    */
     }


    A more optimized code with Comments

    Code:
    /*
      Pre-processor Directives Declaration
    */
    #include <stdio.h>
    #include <conio.h>
    
    /* User-defined Functions */
    int multiply( int x, int y );
    
    /* Function main() */
    int main() {
    /*
     user defined variables declaration part.
    */
    
    
    /*
      main program statements
    */
    clrscr();
    
    printf("The product of 5 and 2 is %d", multiply(5,2));
    
    /*
     wait for user to press any key
    */
    getch();
    
    return 0;
    }
    
    int multiply(intx, int y){
        return(x*y);
    }
    Optimized Code without Comments:
    Code:
    #include <stdio.h>
    #include <conio.h>
    
    int multiply( int x, int y );
    
    int main() {
        clrscr();
    
        printf("The product of 5 and 2 is %i", multiply(5,2));
        getch();
    return 0;
    }
    
    int multiply(intx, int y){
        return(x*y);
    }
    Last edited by ChaosOrb; 03-20-2009 at 01:13 PM.

  3. #13
    makalingaw lagi ni.. mura kog nibalik 1st year.hehehe dili nmn ingon ani sa work uy! nakaremember nlng ko nga support ko next week.. puro defects!

  4. #14
    Junior Member
    Join Date
    Jan 2009
    Gender
    Female
    Posts
    259
    Good luck bro... maayo jud ni imong gibuhat.. ask jud...hehe

  5. #15
    hahahahaah! TC pa gani nagkalisod na.... saon nlng... praktis2x lng gyd braaadd!

  6. #16
    natural rana sa beginners bro..mgkaerror...even mga maayong laki nga programmer mkaencounter jud ug error...heheh...never give up...heheh...

  7. #17
    learn from ur mistakes nalng bro...

    OT: gahia jud ug programming aning master ChaosOrb wui...

  8. #18
    cOOL . congrats nakahimu kag program hehe.

  9.    Advertisement

Page 2 of 2 FirstFirst 12

Similar Threads

 
  1. kung ikaw sa akong posittion unsay buhaton nimu?
    By jaynith avila in forum General Discussions
    Replies: 42
    Last Post: 04-01-2013, 12:25 AM
  2. UNSAY GUBA SA AKONG HARD DISK????
    By MisterSuave in forum Computer Hardware
    Replies: 20
    Last Post: 12-11-2011, 07:19 AM
  3. Birthday sa akong pinalangga! unsay nindot buhaton?
    By momoi in forum General Discussions
    Replies: 26
    Last Post: 09-29-2011, 09:25 PM
  4. Unsay poblema sa akong computer???
    By ididntellu in forum Computer Hardware
    Replies: 15
    Last Post: 03-10-2010, 02:12 AM
  5. unsay problema sa pc sa akong friend?
    By avia in forum Computer Hardware
    Replies: 3
    Last Post: 03-12-2009, 06:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
about us
We are the first Cebu Online Media.

iSTORYA.NET is Cebu's Biggest, Southern Philippines' Most Active, and the Philippines' Strongest Online Community!
follow us
#top