Giter Club home page Giter Club logo

cplusplus's Introduction

This repository contains executibles for Linux and for Windows operating systems.

Dependencies

  • boost c++ libraries (for factorial and bsort programs)

Makefiles

On Windows, programs can be built using the command line tool NMAKE, which is included in Visual Studio. To use NMAKE, you must run it in a Developer Command Prompt window using the following command

nmake -f Makefile.win

fibonacci.cpp

Displays Fibonacci numbers. Your input determines how many Fibonacci numbers to show.

sizeof.cpp

Displays of size of all data types.

limits.cpp

Displays of size of all data types and ranges.

quadratic_roots.cpp

Calculates the roots of a quadratic function.

factorial.cpp (Uses BOOST libraries)

Calculates the factorial of a number using recursion.
Boost/multiprecision library is used for larger ranges

nperfect.cpp

Prints out 'n' perfect numbers where 'n' is the user input. 

A perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the number itself.

rand.cpp

Writes random numbers to a file. Run this program to test sort.cpp

usage

$ ./rand --help
usage: ./rand [-s <n>] [<outfile>]

        -h, --help      Print this help message and exit
        -s, --size <n>  Amount of random numbers to produce [default: 3000]
            <outfile>   output file [default: numbers.dat]

sort.cpp

Takes as input a file containing numbers and arranges them in either ascending or descending order, as well as removes duplicates according to the user's input commands.

usage

$ ./sort --help
usage: ./sort [-a|d] [r] -i <infile> [<outfile>]

        -a, --ascending                 ascending order
        -d, --descending                descending order
        -r, --remove_duplicates         remove duplicates
        -i, --input <infile>            input file
            <outfile>                   output file [default: sorted.dat]
        -h, --help                      display this message
        -v, --version                   display program version

bsort.cpp (Uses BOOST libraries)

This program does the same thing that sort.cpp does except it uses boost/program_options to parse command line arguments.

usage

$ ./bsort --help
Sort v2.0, a program that sorts numbers in either ascending or descending order,
and removes duplicates if the user chooses.

Usage: ./bsort [-a|-d] [r] -i <input> [<output>]

Allowed options:
  -h [ --help ]               produce this message
  -v [ --version ]            version of program
  -a [ --ascending ]          sort in ascending order
  -d [ --descending ]         sort in descending order
  -r [ --remove_duplicates ]  remove duplicates
  -i [ --input ] arg          name of input file

prime.cpp

Prints out prime numbers. Also lets you know whether an integer is prime or not. 

usage

$ ./prime --help
usage: ./prime [-hv] [-c <integer>... | -p [-o <outfile>]]

        -h, --help      Display this help message and exit
        -v, --version   Display program version
        -c, --check     Lets the user know if an integer is prime or not
        -p, --print     Prints prime numbers
        -o, --output    Writes prime numbers to a file

cplusplus's People

Contributors

skp17 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.