Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1

    Default unsay error sa akong program? unsay akong buhaton?


    i'm using c++ and i'm practicing this simple program...
    making a program with the use of function...
    inig compile nako, naay warning nga unreachable code ug function should return a value nga mogawas..

    here's my program:

    #include <stdio.h>
    #include <conio.h>
    int multiply( int x, int y )
    {
    int product;
    product = x * y;
    return product;
    }
    int main()

    {
    clrscr();
    int ans;
    ans = multiply(5, 2);
    printf("The product of 5 and 2 is %d", ans);
    return 0;
    getch();
    }


    pls debug it for me kay di jud ko ka-identify asa ang problema..
    salamat..

  2. #2
    dli na ma execute imo getch() na statement kay nag return naman imo main.
    so bali unreachable na ang getch()

  3. #3
    ^^ return statement dapat naa last sa main.

  4. #4
    hahaha.. mao ra d i nay error sa akong program?
    sori mga bro nagpraktis paman gud ko...
    ok na ang program bro..
    salamat sa inyong mga tabang.. makat-on jud ko ani kay naay daghan motabang diri.
    mo-post lang unya ko kon naa koy ma-encounter nga error..
    salamat...

  5. #5
    ang usa sad ka error ani bro kay kani na statements:

    clrscr();
    int ans;


    dapat ing ani unta:

    int ans;
    clrscr();



    declare all your local variables before calling any functions.

  6. #6
    turbo c ni ? mao gyud ni nakahasol sa turbo c na compiler kanang getch(); ug clrscr(); , heheh anyway Good luck sa programming bro. Try to learn sa function prototype para dali ra malocate imong main function

  7. #7
    first sem programming ni. turbo c. wala pa jud scanf()..

  8. #8
    I think Ok ra wala scanf() kay nihatag naman siya ug parameters sa pag call niya sa multiply na function sa main.

  9. #9
    mao lage.. basic ba. kanang kinapilmerohan jud ug tudlo sa course.. kahinumdom sad ko ingon ani sauna..

  10. #10
    hehe ahw sorry bag.o pa gyud tawn ko human ani na course. Mao fresh pa hehe, next course advance programming na heheh.

  11.    Advertisement

Page 1 of 2 12 LastLast

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