Sei sulla pagina 1di 6

(//www.sanfoundry.

com)

Start trading easily with


Binary Options Bitcoin denominated
accounts. 100+ assets
Trading available.

C++ Programming Examples on Numerical Problems & Algorithms

This section covers C++ Programming Examples on Numerical Problems & Algorithms. Every example program includes the description of the program, C++ code as
well as output of the program. Here is the listing of C++ programming examples:
1. C++ Programming examples on “Solving Linear Equations”

C++ Program to Solve any Linear Equation in One Variable (http://www.sanfoundry.com/cpp-program-solve-any-linear-equation-one-variable/)


C++ Program to Find Inverse of a Matrix (http://www.sanfoundry.com/cpp-program-find-inverse-matrix/)
C++ Program to Perform Encoding of a Message Using Matrix Multiplication (http://www.sanfoundry.com/cpp-program-perform-encoding-message-using-matrix-
multiplication/)
C++ Program to Perform LU Decomposition of any Matrix (http://www.sanfoundry.com/cpp-program-perform-lu-decomposition-any-matrix/)
C++ Program to Implement Coppersmith Winograd Algorithm
C++ Program to Implement Coppersmith Freivald’s Algorithm (http://www.sanfoundry.com/cpp-program-implement-coppersmith-freivalds-algorithm/)
C++ Program to Implement Gauss Jordan Elimination (http://www.sanfoundry.com/cpp-program-implement-gauss-jordan-elimination/)
C++ Program to Implement Gauss Seidel Method (http://www.sanfoundry.com/cpp-program-implement-gauss-seidel-method/)
C++ Program to Represent Linear Equations in Matrix Form (http://www.sanfoundry.com/cpp-program-represent-linear-equations-matrix-form/)
C++ Program to Find Closest Pair of Points in an Array (http://www.sanfoundry.com/cpp-program-find-closest-pair-points-array/)

2. C++ Programming examples on “Bandwidth Reduction”

C++ Program to Implement RCM Algorithm


C++ Program to Optimize Wire Length in Electrical Circuit (http://www.sanfoundry.com/cpp-program-optimize-wire-length-electrical-circuit/)
C++ Program to Perform Bandwidth Reduction on Graphs

3. C++ Programming examples on “Matrix Multiplication”

C++ Program to Perform Matrix Multiplication (http://www.sanfoundry.com/cpp-program-perform-matrix-multiplication/)


C++ Program to Implement Strassen’s Algorithm (http://www.sanfoundry.com/cpp-program-implement-strassens-algorithm/)
C++ Program to Perform Optimal Paranthesization Using Dynamic Programming (http://www.sanfoundry.com/cpp-program-perform-optimal-paranthesization-using-
dynamic-programming/)
C++ Program to Find Path Between Two Nodes in a Graph (http://www.sanfoundry.com/cpp-program-find-path-between-two-nodes-graph/)
C++ Program to Check if it is a Sparse Matrix (http://www.sanfoundry.com/cpp-program-check-if-sparse-matrix/)
C++ Program to Find Basis and Dimension of a Matrix (http://www.sanfoundry.com/cpp-program-find-basis-dimension-matrix/)
C++ Program to Perform Complex Number Multiplication
C++ Program to Check Multiplicability of Two Matrices (http://www.sanfoundry.com/cpp-program-check-multiplicability-two-matrices/)

4. C++ Programming examples on “Determinants and Permanents”

C++ Program to Check if a Matrix is Invertible (http://www.sanfoundry.com/cpp-program-check-if-matrix-invertible/)


C++ Program to Compute Determinant of a Matrix (http://www.sanfoundry.com/cpp-program-compute-determinant-matrix/)

5. C++ Programming examples on “Constrainted and UnConstrained Optimization”

C++ Program to Find Minimum Value of any Algebraic Expression


C++ Program to Find Maximum Value of any Algebraic Expression
C++ Program to Implement Steepest Descent Method and Compute Local Optima
C++ Program to Implement Conjugate Method and Compute Local Optima
C++ Program to Implement Modular Exponentiation Algorithm (http://www.sanfoundry.com/cpp-program-implement-modular-exponentiation-algorithm/)

6. C++ Programming examples on “Linear Programming”

C++ Program to Find Maximum Value of an Expression and Given 3 Inequalities


C++ Program to Optimize Solution for Employer Applicant Mark Problem Using Linear Programming

7. C++ Programming examples on “Random Number Generation”


C++ Program to Generate N Number of Passwords of Length M Each (http://www.sanfoundry.com/cpp-program-generate-n-number-passwords-length-m-each/)
C++ Program to Generate Date Between Given Range
C++ Program to Generate Randomized Sequence of Given Range of Numbers (http://www.sanfoundry.com/cpp-program-generate-randomized-sequence-given-
range-numbers/)
C++ Program to Generate Random Hexadecimal Bytes (http://www.sanfoundry.com/cpp-program-generate-random-hexadecimal-bytes/)
C++ Program to Generate Tetris Game Using Random Number Generation
C++ Program to Create a Random Bitmap Image
C++ Program to Emulate N Dice Roller (http://www.sanfoundry.com/cpp-program-emulate-n-dice-roller/)
C++ Program to Use rand and srand Functions (http://www.sanfoundry.com/cpp-program-use-rand-srand-functions/)
C++ Program to Implement the linear congruential generator for Pseudo Random Number Generation (http://www.sanfoundry.com/cpp-program-implement-linear-
congruential-generator-pseudo-random-number-generation/)
C++ Program to Generate Random Numbers Using Middle Square Method (http://www.sanfoundry.com/cpp-program-generate-random-numbers-using-middle-
square-method/)
C++ Program to Generate Random Numbers Using Multiply with Carry Method (http://www.sanfoundry.com/cpp-program-generate-random-numbers-using-multiply-
with-carry-method/)
C++ Program to Generate Random Numbers Using Probability Distribution Function (http://www.sanfoundry.com/cpp-program-generate-random-numbers-using-
probability-distribution-function/)
C++ Program to Implement Inversion Method for Random Number Generation
C++ Program to Perform Random Number Generation Using Inversion Method
C++ Program to Implement Fisher-Yates Algorithm for Array Shuffling (http://www.sanfoundry.com/cpp-program-implement-fisher-yates-algorithm-array-shuffling/)
C++ Program to Implement Park-Miller Random Number Generation Algorithm (http://www.sanfoundry.com/cpp-program-implement-park-miller-random-number-
generation-algorithm/)
C++ Program to Implement Naor-Reingold Pseudo Random Function (http://www.sanfoundry.com/cpp-program-implement-naor-reingold-pseudo-random-function/)

8. C++ Programming examples on “Factoring and Primality Testing”

C++ Program to Implement wheel Sieve to Generate Prime Numbers Between Given Range (http://www.sanfoundry.com/cpp-program-implement-wheel-sieve-
generate-prime-numbers-between-given-range/)
C++ Program to Implement Sieve of eratosthenes to Generate Prime Numbers Between Given Range (http://www.sanfoundry.com/cpp-program-implement-sieve-
eratosthenes/)
C++ Program to Implement Sieve of Atkin to Generate Prime Numbers Between Given Range (http://www.sanfoundry.com/cpp-program-implement-sieve-atkins/)
C++ Program to Implement Segmented Sieve to Generate Prime Numbers Between Given Range (http://www.sanfoundry.com/cpp-program-implement-segemented-
sieve/)
C++ Program to Implement the Rabin-Miller Primality Test to Check if a Given Number is Prime (http://www.sanfoundry.com/cpp-program-implement-miller-rabin-
primality-test/)
C++ Program to Implement the Solovay-Strassen Primality Test to Check if a Given Number is Prime (http://www.sanfoundry.com/cpp-program-implement-solovay-
strassen-primality-test/)
C++ Program to Find the GCD and LCM of n Numbers (http://www.sanfoundry.com/cpp-program-find-gcd-lcm-n-numbers/)
C++ Program to Perform the Unique Factorization of a Given Number (http://www.sanfoundry.com/cpp-program-perform-unique-factorization-given-number/)
C++ Program to Find GCD of Two Numbers Using Recursive Euclid Algorithm (http://www.sanfoundry.com/cpp-program-find-gcd-two-numbers-using-recursive-
euclid-algorithm/)
C++ Program to Generate Prime Numbers Between a Given Range Using the Sieve of Sundaram (http://www.sanfoundry.com/cpp-program-generate-prime-
numbers-between-given-range-using-sieve-sundaram/)
C++ Program to Perform Baillie-PSW Primality Test
C++ Program to Perform Fermat Primality Test (http://www.sanfoundry.com/cpp-program-implement-fermat-primality-test/)

9. C++ Programming examples on “Arbitrary-Precision Arithmetic”

C++ Program to Perform Addition Operation Using Bitwise Operators (http://www.sanfoundry.com/cpp-program-perform-addition-operation-using-bitwise-operators/)


C++ Program to Implement Booth’s Multiplication Algorithm for Multiplication of 2 signed Numbers (http://www.sanfoundry.com/cpp-program-implement-booths-
multiplication-algorithm-multiplication-2-signed-numbers/)
C++ Program to Implement the Schonhage-Strassen Algorithm for Multiplication of Two Numbers (http://www.sanfoundry.com/cpp-program-implement-schonhage-
strassen-algorithm-multiplication-two-numbers/)
C++ Program to Perform Arithmetic Operations on Numbers of Size Greater than that of Int Without Using any Data Type of Size Greater than Int
C++ Program to Implement Russian Peasant Multiplication (http://www.sanfoundry.com/cpp-program-implement-russian-peasant-multiplication/)
C++ Program to Implement Euler Theorem (http://www.sanfoundry.com/cpp-program-implement-euler-theorem/)
C++ Program to Implement Extended Euclidean Algorithm (http://www.sanfoundry.com/cpp-program-implement-extended-eucledian-algorithm/)
C++ Program to Implement Fermat’s Little Theorem (http://www.sanfoundry.com/cpp-program-implement-fermat-little-theorem/)

10. C++ Programming examples on “Knapsack Problem”

C++ Program to Solve the 0-1 Knapsack Problem (http://www.sanfoundry.com/cpp-program-solve-0-1-knapsack-problem/)


C++ Program to Solve the Fractional Knapsack Problem (http://www.sanfoundry.com/cpp-program-solve-fractional-knapsack-problem/)
C++ Program to Perform Partition of an Integer in All Possible Ways (http://www.sanfoundry.com/cpp-program-perform-partition-integer-all-possible-ways/)
C++ Program to Fill Given n Numbers into a Given N Number and Ensure that Minimum is Left from N
C++ Program to Implement the Bin Packing Algorithm (http://www.sanfoundry.com/cpp-program-implement-bin-packing-algorithm/)
C++ Program to Solve Knapsack Problem Using Dynamic Programming (http://www.sanfoundry.com/cpp-program-solve-knapsack-problem-using-dynamic-
programming/)
C++ Program to Calculate Maximum Payoff by ReOrdering Two Given Sets

11. C++ Programming examples on “Discrete Fourier Transform”

C++ Program to Compute DFT Coefficients Directly (http://www.sanfoundry.com/cpp-program-compute-dft-coefficients-directly/)


C++ Program to Compute Discrete Fourier Transform Using Naive Approach (http://www.sanfoundry.com/cpp-program-compute-discrete-fourier-transform-using-
naive-approach/)
C++ Program to Compute Discrete Fourier Transform Using the Fast Fourier Transform Approach (http://www.sanfoundry.com/cpp-program-compute-discrete-
fourier-transform-using-fast-fourier-transform-approach/)
C++ Perform to a 2D FFT Inplace Given a Complex 2D Array (http://www.sanfoundry.com/cpp-perform-2d-fft-inplace-given-complex-2d-array/)
12. C++ Programming examples on “Factorials and Fibonacci Numbers”

C++ Program to Find Factorial of a Number using Recursion (http://www.sanfoundry.com/cpp-program-find-factorial-recursion/)


C++ Program to Find Factorial of a Number using Iteration (http://www.sanfoundry.com/cpp-program-find-factorial-number-iteration/)
C++ Program to Find Factoial of a Number using Dynamic Programming (http://www.sanfoundry.com/cpp-program-find-factorial-number-dynamic-programming/)
C++ Program to Find Factorial of Large Numbers (http://www.sanfoundry.com/cpp-program-find-factorial-large-numbers/)
C++ Program to Find Fibonacci Numbers using Recursion (http://www.sanfoundry.com/cpp-program-find-fibonacci-numbers-recursion/)
C++ Program to Find Fibonacci Numbers using Iteration (http://www.sanfoundry.com/cpp-program-find-fibonacci-numbers-iteration/)
C++ Program to Find Fibonacci Numbers using Dynamic Programming (http://www.sanfoundry.com/cpp-program-find-fibonacci-numbers-dynamic-programming/)
C++ Program to Find Fibonacci Numbers using Matrix Exponentiation (http://www.sanfoundry.com/cpp-program-find-fibonacci-numbers-matrix-exponentiation/)

If you want to learn implementations of all algorithms and programs in C++, Here’s the list of 1000 C++ Algorithms, Problems & Programming Examples
(http://www.sanfoundry.com/1000-cpp-algorithms-problems-programming-examples/).

Deep Dive @ Sanfoundry:


1. C Program to Implement Coppersmith Freivald’s Algorithm (http://www.sanfoundry.com/c-program-implement-coppersmith-freivalds-algorithm/)
2. Java Program to Implement the linear congruential generator for Pseudo Random Number Generation (http://www.sanfoundry.com/java-program-
implement-linear-congruential-generator/)
3. C Program to Implement Strassen’s Algorithm (http://www.sanfoundry.com/c-program-implement-strassens-algorithm/)
4. C++ Program to Compute Combinations using Matrix Multiplication (http://www.sanfoundry.com/cpp-program-compute-combinations-matrix-
multiplication/)
5. C Program to Find Prime Numbers in a given Range (http://www.sanfoundry.com/c-program-prime-numbers-given-range/)
6. C++ Program to Implement Park-Miller Random Number Generation Algorithm (http://www.sanfoundry.com/cpp-program-implement-park-miller-random-
number-generation-algorithm/)
7. Java Program to Implement Coppersmith Freivald’s Algorithm (http://www.sanfoundry.com/java-program-implement-coppersmith-freivald/)
8. C Program to Implement wheel Sieve to Generate Prime Numbers Between Given Range (http://www.sanfoundry.com/c-program-implement-wheel-sieve-
generate-prime-numbers-between-given-range/)
9. T-Primes Problem – Dynamic Programming Solutions (http://www.sanfoundry.com/dynamic-programming-solutions-t-primes-problem/)
10. C Program to Implement Sieve of eratosthenes to Generate Prime Numbers Between Given Range (http://www.sanfoundry.com/c-program-implement-
sieve-eratosthenes-generate-prime-numbers/)

HOW MUCH DO YOU KNOW ABOUT ROBOTS? 

How was the rst working robot


employed in 1961? 15

A Searching for gold


B Spying on Russian-American families
C Watering at the Olive Garden
D Making cars for Ford Your Score 0 Question 1/10

Sponsored

Manish Bhojasia (http://www.sanfoundry.com/about/), a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at
Sanfoundry. He is Linux Kernel Developer and SAN Architect and is passionate about competency developments in these areas. He lives in
Bangalore and delivers focused training sessions to IT professionals in Linux Kernel, Linux Debugging, Linux Device Drivers, Linux
Networking, Linux Storage & Cluster Administration, Advanced C Programming, SAN Storage Technologies, SCSI Internals and Storage
Protocols such as iSCSI & Fiber Channel. Stay connected with him below:
LinkedIn (http://www.linkedin.com/in/manishbhojasia) | Facebook (http://www.facebook.com/sanfoundry) | Twitter
(http://www.twitter.com/sanfoundry) | Google+ (https://plus.google.com/104408026570656234343/posts)

Subscribe Sanfoundry Newsletter and Posts


Name*

Email*

Subscribe

Best Careers

Developer Tracks (http://www.sanfoundry.com/salary-50l/)


SAN Developer (http://www.sanfoundry.com/san-storage-developer-training-courses/)
Linux Kernel Developer (http://www.sanfoundry.com/linux-kernel-developer-training-courses-jobs/)
Linux Driver Developer (http://www.sanfoundry.com/linux-device-driver-developer-training/)
Linux Network Developer (http://www.sanfoundry.com/linux-network-developer-training/)

Live Training Photos (http://www.sanfoundry.com/sanfoundry-classes/)


Mentoring (http://www.sanfoundry.com/professional-mentoring-coaching-career-guidance-cto/)
Software Productivity (http://www.sanfoundry.com/programming-discipline-and-software/)
GDB Assignment (http://www.sanfoundry.com/gdb-example-tutorial/)

Trade Binary Options

Trade on 100+ underlying


assets. Bitcoin denominated
account. Est. 2000.

Sanfoundry is No. 1 choice for Deep Hands-ON Trainings in SAN, Linux & C, Kernel Programming. Our Founder has trained employees of almost all Top Companies in
India such as VMware, Citrix, Oracle, Motorola, Ericsson, Aricent, HP, Intuit, Microsoft, Cisco, SAP Labs, Siemens, Symantec, Redhat, Chelsio, Cavium, ST-Micro,
Samsung, LG-Soft, Wipro, TCS, HCL, IBM, Accenture, HSBC, Mphasis, Tata-Elxsi, Tata VSNL, Mindtree, Cognizant and Startups.

Best Trainings

SAN I - Technology (http://www.sanfoundry.com/san-storage-area-networks-training/)


SAN II - Admin (http://www.sanfoundry.com/san-administration-training-course/)
Linux Fundamentals (http://www.sanfoundry.com/linux-administration-training/)
Advanced C Training (http://www.sanfoundry.com/advanced-c-programming-training/)
Linux-C Debugging (http://www.sanfoundry.com/training-on-linux-debugging-techniques/)
System Programming (http://www.sanfoundry.com/training-on-linux-internals-systems/)
Network Programming (http://www.sanfoundry.com/training-socket-network-programming/)
Linux Threads (http://www.sanfoundry.com/training-multithreaded-parallel/)
Kernel Programming (http://www.sanfoundry.com/linux-kernel-internals-training/)
Kernel Debugging (http://www.sanfoundry.com/linux-kernel-debugging-training/)
Linux Device Drivers (http://www.sanfoundry.com/training-on-linux-device-drivers/)

Trade Binary Options

Trade on 100+ underlying


assets. Bitcoin denominated
account. Est. 2000.

Best Reference Books

Computer Science Books (http://www.sanfoundry.com/best-reference-books-computer-science-engineering/)


Algorithm & Programming Books (http://www.sanfoundry.com/best-reference-books-programming-hot-technologies)
Electronics Engineering Books (http://www.sanfoundry.com/best-reference-books-electrical-electronics-engineering/)
Electrical Engineering Books (http://www.sanfoundry.com/best-reference-books-electrical-electronics-engineering/)
Chemical Engineering Books (http://www.sanfoundry.com/best-reference-books-chemical-engineering/)
Civil Engineering Books (http://www.sanfoundry.com/best-reference-books-civil-engineering/)
Mechanical Engineering Books (http://www.sanfoundry.com/best-reference-books-mechanical-engineering/)
Industrial Engineering Books (http://www.sanfoundry.com/best-reference-books-industrial-engineering-operations-research/)
Instrumentation Engg Books (http://www.sanfoundry.com/best-reference-books-instrumentation-engineering/)
Metallurgical Engineering Books (http://www.sanfoundry.com/best-reference-books-metallurgical-engineering/)
All Stream Best Books (http://www.sanfoundry.com/best-reference-books-tech-engineering-sciences/)

Questions and Answers

1000 C Questions & Answers (http://www.sanfoundry.com/c-interview-questions-answers/)


1000 C++ Questions & Answers (http://www.sanfoundry.com/cplusplus-interview-questions-answers/)
1000 C# Questions & Answers (http://www.sanfoundry.com/1000-csharp-questions-answers/)
1000 Java Questions & Answers (http://www.sanfoundry.com/java-questions-answers-freshers-experienced/)
1000 Linux Questions & Answers (http://www.sanfoundry.com/technical-interview-questions/)
1000 Python Questions (http://www.sanfoundry.com/1000-python-questions-answers/)
1000 PHP Questions & Answers (http://www.sanfoundry.com/1000-php-questions-answers/)
1000 Hadoop Questions (http://www.sanfoundry.com/1000-hadoop-questions-answers/)
Cloud Computing Questions (http://www.sanfoundry.com/1000-cloud-computing-questions-answers/)
Computer Science Questions (http://www.sanfoundry.com/computer-science-questions-answers/)
All Stream Questions & Answers (http://www.sanfoundry.com/)

India Internships

Computer Science Internships (http://www.sanfoundry.com/internships-computer-science-engineering/)


Instrumentation Internships (http://www.sanfoundry.com/internships-instrumentation-engineering/)
Electronics Internships (http://www.sanfoundry.com/internships-electronics-electrical-engineering/)
Electrical Internships (http://www.sanfoundry.com/internships-electronics-electrical-engineering/)
Mechanical Internships (http://www.sanfoundry.com/internships-mechanical-engineering/)
Industrial Internships (http://www.sanfoundry.com/internship-industrial-engineering/)
Systems Internships (http://www.sanfoundry.com/internships-systems-control-engineering/)
Chemical Internships (http://www.sanfoundry.com/internships-chemical-engineering/)
Civil Internships (http://www.sanfoundry.com/internships-civil-engineering/)
IT Internships (http://www.sanfoundry.com/internship/)
All Stream Internships (http://www.sanfoundry.com/internship/)

About Sanfoundry

About Us (http://www.sanfoundry.com/about/)
Copyright (http://www.sanfoundry.com/copyright/)
TOS & Privacy (http://www.sanfoundry.com/tos-privacy-policy/)
Jobs (http://www.sanfoundry.com/jobs/)
Bangalore Training (http://www.sanfoundry.com/coursesfees/)
Online Training (http://www.sanfoundry.com/online-training-san-linux-kernel-device-drivers/)
SAN Training (http://www.sanfoundry.com/san-storage-area-networks-training/)
Developers Track (http://www.sanfoundry.com/salary-50l/)
Mentoring Sessions (http://www.sanfoundry.com/professional-mentoring-coaching-career-guidance-cto/)
Contact Us (http://www.sanfoundry.com/contact/)
Sitemap (http://www.sanfoundry.com/sitemap_index.xml)

© 2011-2018 Sanfoundry

Potrebbero piacerti anche