473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

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:

Expand|Select|Wrap|Line Numbers
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. int main()
  6. {
  7.     int num1,num2;
  8.  
  9.  
  10.     printf("Enter a number: ");
  11.     scanf("%d", &num1);
  12.  
  13.     for(num2 = 0; num2 < 9; num2++)
  14.     {
  15.     printf("power %d: %d\n", num2, ((int)(num1/pow(2, num2))));
  16.     }
  17.  
  18.     return;
  19. }




Program 2:
Expand|Select|Wrap|Line Numbers
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <math.h>
  4.  
  5. int main()
  6. {
  7.     int num1,num2,num3;
  8.  
  9.  
  10.     printf("Enter a number: ");
  11.     scanf("%d", &num1);
  12.  
  13.  
  14.     for(num2 = 0; num2 < 9; num2++)
  15.     {
  16.     num3=  num1>>num2;
  17.  
  18.     printf("power %d: %d\n", num2, num3);
  19.  
  20.     }
  21.     return;
  22. }


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!!
Oct 29 '07 #1
3 1128
Ganon11
3,652 Expert 2GB
Sounds like a homework assignment...so what ideas have you come up with so far?
Oct 29 '07 #2
sounds like a horrible topic title. BTW, if you want help, show the experts that you did some work...
Oct 29 '07 #3
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
Oct 29 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: gilgantic | last post by:
How do you deal with floating points in J2ME? From my understanding MIDP 1.0 does not allow you to use float or double primitives. I want to be able to perform a calculations which give float or...
3
by: fabio de francesco | last post by:
Hello, I have a couple of years of experience with C++. I started studying C++ syntax, then I read the B.Stroustrup's book, and eventually I went through the N.Josuttis' book on how to program...
7
by: Thiru | last post by:
I am writing an application that interacts with Oracle and Teradata. In order to create the executable, I need to link various Oracle and Teradata libraries. I found out that when I link the...
11
by: Saurabh | last post by:
Hi all, I want to know why do we use libraries(static or shared). We can perform that work by including header files too.I also wish to know what exactly is linking and loading. i know these...
36
by: Martin Larsen | last post by:
Hi, When a PHP program links to a library using include or require (or their _once variations), is the library then linked dynamically or statically? While it might seem irrelevant from a...
4
by: Freddy Coal | last post by:
Hi, I would like know if something libraries or programs exist, and send error with a description if the program don't find the libraries, how can make that?. For example: In the use of...
16
by: pereges | last post by:
ok so i have written a program in C where I am dealing with huge data(millions and lots of iterations involved) and for some reason the screen tends to freeze and I get no output every time I...
42
by: lorlarz | last post by:
Contrary to what one authority in the JavaScript field says: JavaScript does make errors when dealing with just with integers. This authority (Douglas Crockford.) says: "integer arithmetic in...
0
AmberJain
by: AmberJain | last post by:
Windows Autorun FAQs: Programs dealing with autoruns Linked from the Original article- "Windows Autorun FAQs: Description". Que: Can you list programs that help me to view/modify the autoruns...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.