Dealing with libraries in program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • The Advocate
    New Member
    • Oct 2007
    • 6

    Dealing with libraries in program

    Hey!!! I have this C code that I implemented and there are few questions about it! I kindly request some help in answering them. Here is the code and followed are the questions!..I really appreciate ur help coz im running out of time!

    Program1:

    [CODE=c]#include <stdio.h>
    #include <stdlib.h>
    #include <math.h>

    int main()
    {
    int num1,num2;


    printf("Enter a number: ");
    scanf("%d", &num1);

    for(num2 = 0; num2 < 9; num2++)
    {
    printf("power %d: %d\n", num2, ((int)(num1/pow(2, num2))));
    }

    return;
    }[/CODE]





    Program 2:
    [CODE=c]#include <stdio.h>
    #include <stdlib.h>
    #include <math.h>

    int main()
    {
    int num1,num2,num3;


    printf("Enter a number: ");
    scanf("%d", &num1);


    for(num2 = 0; num2 < 9; num2++)
    {
    num3= num1>>num2;

    printf("power %d: %d\n", num2, num3);

    }
    return;
    }[/CODE]



    Answer managing to get the first two sets of programs to run correctly:
    1. How is the math library available within the file system?
    2. What are the names of the files that correspond to the math library?
    3. List at least two possible ways for linking against the math library.
    4. Is there an alternative way for generating the “string-compare-2”executable file? If yes, describe it.

    THANKS AGAIN!!
    Last edited by Ganon11; Oct 29 '07, 03:37 AM. Reason: Please use the [CODE] tags provided.
  • Ganon11
    Recognized Expert Specialist
    • Oct 2006
    • 3651

    #2
    Sounds like a homework assignment...so what ideas have you come up with so far?

    Comment

    • mohaakilla51
      New Member
      • Jul 2007
      • 39

      #3
      sounds like a horrible topic title. BTW, if you want help, show the experts that you did some work...

      Comment

      • The Advocate
        New Member
        • Oct 2007
        • 6

        #4
        well the help that i need is more like a hint to the questions..
        1. what is meant by a file system here in the program?
        2. How can we link to the math library? I read few posts about linking libraries in C in this forum but they weren't specifically concerning how to link the math library

        Comment

        Working...