Skip to main content

Posts

Showing posts from February 27, 2018

C++ : Program to find simple Interest and compound Interest

Program to find simple Interest and compound Interest #include<iostream> using namespace std; int main() {     int p, r, t;     float si, ci;     cout << "Enter value for P R T" << endl;     cin >> p >>r >> t;     si = p*r*t/100;     ci = p*(1+r/100)^t;     cout << "SIMPLE INTREST = " <<si <<"\n" << "COMPOUND INTERESRT= " << ci;     return 0; }

C++ : Program to check whether the entered number is odd or even

Program to check whether the entered number is odd or even  #include <iostream> using namespace std; int main() {     int num;     cout << "Enter any number: ";     cin >> num;     if (num%2 == 0)         cout << "Number is even";     else         cout << "Number is odd";     return 0;    }

C++: program to input three numbers and print the largest of three

    Program to input three numbers and print the largest of three #include <iostream> using namespace std; int main() {     int x,y,z;     cout << "Enter three NUMBER: "<< "\n";     cin >> x >> y >> z;     if(x>y && x>z)     cout << "\n" << x << " is greater";     if (y > x && y > z)     cout << "\n" << y << " is greater";     if (z > x && z > y)     cout << "\n" << z << " is greater";     return 0;     }

C++ :Program that reads temperature in Celsius and displays it in Fahrenheit

Program that reads temperature in Celsius and displays it in Fahrenheit #include <iostream> using namespace std; int main() {         int celsius, fahrenheit;     cout << "Enter temperature in dgree Celcius ";     cin >> celsius;     fahrenheit = 9* celsius/5 +32;     cout << "Temperature in dgrese FAHRENHET: " << fahrenheit << endl;     return 0; }

C++: Program to check wether a number is greater than or less than other number

Program to check wether a number is greater than or less than other number #include <iostream> using namespace std; int main() {     int num1, num2;     cout << "Enter value for num1:"; cin >> num1;     cout << "Enter value for num2: "; cin >> num2;     if (num1 > num2)         cout << "Num1 is greater than num 2\n";     else         cout <<"num1 is smaller than num 2\n";     return 0; }

C++: Program To find Sum of Two numbers

C++: Program To find Sum of Two numbers #include <iostream> using namespace std; int main() {     int num1, num2, sum;     cout << "Enter Number 1: ";     cin >> num1;     cout << "Enter number 2: ";     cin >> num2;     sum = num1 + num2;     cout << "sum of number: " << sum << "\n";     return 0; } Output -