[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

Simple bc examples

Posted on 1999-12-03
3
Medium Priority
?
642 Views
Last Modified: 2013-12-26
I'm trying to figure out this bc calculator, but the man page doesn't seem to be very helpful to me.  Can I just get a quick and simple example of a short bc program for the SunOS 5.7 version?
0
Comment
Question by:scottd1978
3 Comments
 
LVL 2

Accepted Solution

by:
basant earned 200 total points
ID: 2253678
See the file
www.snippets.org
Go to General Function
and see the files eval.c and eval.how
0
 
LVL 85

Expert Comment

by:ozo
ID: 2253701
         scale = 20
          define e(x){
               auto a, b, c, i, s
               a = 1
               b = 1
               s = 1
               for(i=1; 1==1; i++){
                    a = a*x
                    b = b*i
                    c = a/b
                    if(c == 0) return(s)
                    s = s+c
               }
          }

          for(i=1; i<=10; i++) e(i)
0
 

Author Comment

by:scottd1978
ID: 2253743
Thanx.  I tried that earlier, but was being a dummy and didn't put the last line that prints everything out in there.  Duh.  
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Ready to get certified? Check out some courses that help you prepare for third-party exams.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Kernel Data Recovery is a renowned Data Recovery solution provider which offers wide range of softwares for both enterprise and home users with its cost-effective solutions. Let's have a quick overview of the journey and data recovery tools range he…
Suggested Courses

590 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question