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

    Default C Puzzle (bag o)


    unsa may output ani heheheeh way tikasay ha...
    Code:
    void f(int, int);
    
    main()
    {
    Â* int x = 5;
    Â* printf("x : %d \t\t %d\n", x++, ++x);
    Â* f(x, x++);
    }
    
    void f(int x, int y)
    {
    Â* printf("f : x = %d \t y = %d\n", x, y);
    }
    gihimoan nalang nako ug lain nga thread ni.. kay way klaro kung isumpay ra nako sa pikas thread... https://www.istorya.net/forums/index.php?topic=40930.0 take note ha wala pay nakatubag ani so far.. lisod tingali ni kaau lol

  2. #2

    Default Re: C Puzzle (bag o)

    postincrement and preincrement exercise.


    void f(int, int);

    main()
    {
    int x = 5;
    printf("x : %d \t\t %d\n", x++, ++x); // ang outpuit ani is x: 6 6
    // x is now 7, because it's postincremented by 1
    f(x, x++); // C evaluates the left param first, then postincremented
    }

    void f(int x, int y)
    {
    printf("f : x = %d \t y = %d\n", x, y); // y = 7, since it's postincrementedm x:8
    }

  3. #3

    Default Re: C Puzzle (bag o)

    Quote Originally Posted by gloryhunter
    postincrement and preincrement exercise.


    void f(int, int);

    main()
    {
    Â* int x = 5;
    Â* printf("x : %d \t\t %d\n", x++, ++x); // ang outpuit ani is x: 6Â* 6
    Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* // x is now 7, because it's postincremented by 1
    Â* f(x, x++);Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â* Â*// C evaluates the left param first, then postincremented
    }

    void f(int x, int y)
    {
    Â* printf("f : x = %d \t y = %d\n", x, y); // y = 7,Â* since it's postincrementedm x:8
    }
    so meaning.. mao ni ang output:
    Code:
    x : 6Â* Â* Â* Â* Â* Â* 6
    f : x = 8Â* Â* Â* Â* y = 7
    hhehe ok sakto.. maayo pagka comment pre.. pero naay kuwang... 50% pasar..!

    take note, mga pre.. sayon nalang ha.. gi answeran na ni gloryhunter ang katunga sa puzzle.. heheh (o ha hint na to ha)

  4. #4

    Default Re: C Puzzle (bag o)

    bumping! anyone?

  5. #5

    Default Re: C Puzzle (bag o)

    ni answer ko ani sa pikas... sayop ako... noob man gud!

  6. #6

    Default Re: C Puzzle (bag o)

    6, 6
    7, 8


  7. #7

    Default Re: C Puzzle (bag o)

    kani beh hehe
    #include<iostream>
    using namespace std
    main() {

    cout << "hello Garci";

    }

  8. #8

    Default Re: C Puzzle (bag o)


    x: 5 7
    f: 7 7


    mao ni akng answer sa pikas.. hehehehe




  9. #9

    Default Re: C Puzzle (bag o)

    Quote Originally Posted by silent-kill
    kani beh hehe
    #include<iostream>
    using namespace std
    main() {

    cout << "hello Garci";

    }
    nsa may nakalisod ana?

    print ra mana sa console ug hello Garci

  10. #10

    Default Re: C Puzzle (bag o)

    ni ingon diay ko lisod?, anyways i was just kidding around..

  11.    Advertisement

Page 1 of 2 12 LastLast

Similar Threads

 
  1. unsay minimum req. sa bag-o nga linux OS?
    By CicatriX in forum Computer Hardware
    Replies: 5
    Last Post: 03-01-2013, 03:20 PM
  2. C Puzzle
    By M@rv|n in forum Programming
    Replies: 45
    Last Post: 05-10-2007, 02:29 PM
  3. Replies: 23
    Last Post: 08-05-2005, 08:35 AM
  4. tabang bag-0 paku aning istorya .net
    By ghems in forum Support Center
    Replies: 1
    Last Post: 05-30-2005, 10:10 AM

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