Sponsored Content
Special Forums UNIX Desktop Questions & Answers need help writing a program to look for doubles Post 302306449 by rickym2626 on Sunday 12th of April 2009 10:05:34 PM
Old 04-12-2009
need help writing a program to look for doubles

to determine if two two doubles are equal, we check to see if
their absolute difference is very close to zero. . .if two numbers
are less than .00001 apart, theyre equal.
keep a count field in each record (as you did in p5).
once the list is complete, ask the user to see if an element
is on the list--read her/his input from the keyboard.
here is what i got

code
#include "ll.h"
#include <stdio.h>
int main() {
int info;
lnode * head ;
head = getlist();
if (find(10, head)) fprintf("%d is on the list\n",10);
else fprintf("%d is not on the list\n",10);
if (find(178, head)) fprintf("%d is on the list\n",178);
printlist(head);
return 0;
}

also have a ll.h a makefile and a input file. but im just not understanding the program and how to start it.
 

10 More Discussions You Might Find Interesting

1. What is on Your Mind?

I'm writing a new Linux program!

Yep, that's right. I'm writing a Linux binary that requires an X11 Server. It will also be released in a Shell, Win32, and Cocoa (Mac OS X). It's a program that's a text editor and more. It not just creates TXT and RTF files, it also can save in XML, RSS, and a whole lot of other formats. ... (11 Replies)
Discussion started by: Danny_10
11 Replies

2. UNIX for Dummies Questions & Answers

writing a program

i have written a very simple program in the vi editor, how do i now make it an executable file? (3 Replies)
Discussion started by: carlvernon
3 Replies

3. Shell Programming and Scripting

Need help on a program I'm writing

Hey guys.. I'm trying to learn how to script in bash... THIS IS NOT AN ASSIGNMENT but my instructor says to learn you must practice I'm trying to add to a program I'm writing that will print and save raw data... What syntax commands would I use to write them? And Thank you... (2 Replies)
Discussion started by: dmosheye
2 Replies

4. Shell Programming and Scripting

writing math testing program

Can anyone create a program that would test the math skills of the user. Assume that it would test integer addition, The program should ask the question,collect the integer response, evaluate and notify the user if their answer was correct or incorrect. I would assume integers in the range... (5 Replies)
Discussion started by: ccp
5 Replies

5. UNIX for Dummies Questions & Answers

Problem with writing a program

Hi guys I'm having trouble with trying to create a script which calculates the grade of a student and the marks out of 300. The grades are: 0-49% fail 50-59% pass 60-69% credit pass 70-79% distinction 80-100% high distinction less than 0 or greater than 100 displays error message. My... (1 Reply)
Discussion started by: CompNoob
1 Replies

6. Programming

writing a shell program in ubuntu

Hi all, I have an assignment from school to write a shell program in linux. the idea is to exercise fork() and execv() functions.. the shell program is supposed to be the master and every command that the user prints will run in a new process. we also need to try running the command in every... (1 Reply)
Discussion started by: r3vive
1 Replies

7. Programming

Writing C++ program Arguments and Classes

I want to write a C++ program that uses a class to do some calculations. I pass arguments to the program, some of which are used to set up class members. A class function will then perform the necessary calculations. I am wondering how I should pass the arguments from the program to set the... (2 Replies)
Discussion started by: kristinu
2 Replies

8. Homework & Coursework Questions

Help with writing a tee program in 4 hours

1. The problem statement, all variables and given/known data: Basic Assignment Write a program similar to the Unix "tee" command. Program The Unix "tee" command is used to pull out copies of a data stream. It is typically used in conjunction with pipes (analogous to a T-joint in plumbing, hence... (1 Reply)
Discussion started by: izzy077
1 Replies

9. Programming

Writing a search, copy and paste program

Hello, Can some one help me by writing me the script of a program that does the following simple functions on a Linux Mint: 1. it runs in the background all the time, doing nothing except of checking if there is any external device mounted. 2. when the device is detected, it copies files... (1 Reply)
Discussion started by: Black_Ardilla
1 Replies

10. Homework & Coursework Questions

Need help writing a shell script program

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write the a shell script program to remove all space characters stored in the shell variable TEXT.... (7 Replies)
Discussion started by: kofine05
7 Replies
GIT-CHERRY(1)							    Git Manual							     GIT-CHERRY(1)

NAME
git-cherry - Find commits not merged upstream SYNOPSIS
git cherry [-v] [<upstream> [<head> [<limit>]]] DESCRIPTION
The changeset (or "diff") of each commit between the fork-point and <head> is compared against each commit between the fork-point and <upstream>. The commits are compared with their patch id, obtained from the git patch-id program. Every commit that doesn't exist in the <upstream> branch has its id (sha1) reported, prefixed by a symbol. The ones that have equivalent change already in the <upstream> branch are prefixed with a minus (-) sign, and those that only exist in the <head> branch are prefixed with a plus (+) symbol: __*__*__*__*__> <upstream> / fork-point \__+__+__-__+__+__-__+__> <head> If a <limit> has been given then the commits along the <head> branch up to and including <limit> are not reported: __*__*__*__*__> <upstream> / fork-point \__*__*__<limit>__-__+__> <head> Because git cherry compares the changeset rather than the commit id (sha1), you can use git cherry to find out if a commit you made locally has been applied <upstream> under a different commit id. For example, this will happen if you're feeding patches <upstream> via email rather than pushing or pulling commits directly. OPTIONS
-v Verbose. <upstream> Upstream branch to compare against. Defaults to the first tracked remote branch, if available. <head> Working branch; defaults to HEAD. <limit> Do not report commits up to (and including) limit. SEE ALSO
git-patch-id(1) GIT
Part of the git(1) suite Git 1.7.10.4 11/24/2012 GIT-CHERRY(1)
All times are GMT -4. The time now is 03:32 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy