Search
 
SCRIPT & CODE EXAMPLE
 

CPP

c++ program for inflation rate of two numbers

#include <iostream>
using namespace std;
double InflationRate(float x, float z);
int main()
{  
    float x, z;
    cout << "Enter the old indicies:";
    cin >> x;
    cout << "Enter the new indicies:";
    cin>> z;
    double Rate = InflationRate(x, z);
    cout << "Inflation rate is: " << Rate << endl;
    return 0;
}
double InflationRate (float x, float z)
{
   if(x<0||z<0||x==0)
   return 0;
   return (z - x) / x * 100;

}
Comment

PREVIOUS NEXT
Code Example
Cpp :: A Subtask Problem codechef solution in cpp 
Cpp :: c++ text between substrings 
Cpp :: reading matrix from text file in c++ and adding them and then storing them in oother c++ file 
Cpp :: reverse a stack in c++ using another stack 
Cpp :: c++ constructor inheritance 
Cpp :: c++ over load oprator to print variable of clas 
Cpp :: c++ conditional typedef 
Cpp :: c++ require keyword 
Cpp :: sqrt function in c++ 
Cpp :: how to open program in c++ 
Cpp :: Qt asynchronous HTTP request 
Cpp :: C++ std::ofstream class members 
Cpp :: Edmonds-Karp algorithm C++ 
Cpp :: c/c++ pointers 
Cpp :: convert java to c++ 
Cpp :: enqueue function with linked list implementation in c++ 
Cpp :: 2000pp pp play osu std 
Cpp :: set keybinding for compiling c++ program in neovim 
Cpp :: how to calculate marks in C++ 
Cpp :: do c++ ints neeed to be initlaized 
Cpp :: how to user input in string to open files in c++ 
Cpp :: c++ 
Cpp :: qt c++ thread example 
Cpp :: how to delete repeated element in stack c++ 
Cpp :: printing sub arrays 
Cpp :: Problems in your to-do list codechef solution in c++ 
Cpp :: What will be the values of variables p, q and i at the end of following loop? int p = 5; int q = 18; for(int i=1;i&lt;5;i++) p++; --q; 
Cpp :: Codeforces Round #376 (Div. 2), problem: (A) Night at the Museum 
Cpp :: tic tac toe in cpp 
Cpp :: delete node in a linked list leetcode 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =