c questions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • muskan
    New Member
    • Nov 2006
    • 35

    c questions

    hello,

    I want to know the answer of these following question....... ....

    . main()
    {
    fork();
    fork();
    fork();
    printf("\n hello");
    }
    How many times print command is executed?


    which one will over flow given two programs
    prog 1: prog2:
    main() main()
    { {
    int fact; int fact=0
    long int x; for(i=1;i<=n;i+ +)
    fact=factoral(x ); fact=fact*i;
    } }

    int factorial(long int x)
    {
    if(x>1) return(x*factor ial(x-1);
    }
    a) program 1;
    b) program 2;
    c) both 1 &2
    d) none
    }


    variables of fuction call are allocated in
    a) registers and stack
    b) registers and heap
    c) stack and heap


    . size of integer is
    a. 2 bytes
    b. 4 bytes
    c. machine dependant
    d. compiler dependent.


    Pls tell .it is very urgent

    thanks
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    What answers would you give? What are your thoughts on these questions?

    Comment

    Working...