Unsigned long problem in c coding

Discussion in 'Introductions' started by ravitejapallapothu, Jul 31, 2019.

  1. ravitejapallapothu

    ravitejapallapothu

    Joined:
    Jul 31, 2019
    Messages:
    2
    Likes Received:
    0
    Hi all,
    I found these lines of code in one of the c file.
    int main()
    {
    unsigned long a;
    a= fun(1000);
    return 0;
    }

    unsigned long fun(unsigned long ms)
    {
    unsigned long us = ms * 10L;
    return us;
    }

    can anyone explain the value of a which is printed after computing its value?
     
    ravitejapallapothu, Jul 31, 2019
    #1
    1. Advertisements

  2. ravitejapallapothu

    ravitejapallapothu

    Joined:
    Jul 31, 2019
    Messages:
    2
    Likes Received:
    0
     
    ravitejapallapothu, Jul 31, 2019
    #2
    1. Advertisements

  3. ravitejapallapothu

    John Joe

    Joined:
    Apr 25, 2017
    Messages:
    118
    Likes Received:
    14
    Location:
    Malaysia
    What's the output you got?
     
    John Joe, Aug 1, 2019
    #3
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.