#include <stdio.h>
#include <conio.h>
void main()
{
float p, r, si;
int t;
clrscr();
printf("Enter the values of p,r and t\n");
scanf ("%f %f %d", &p, &r, &t);
si = (p * r * t)/ 100.0;
printf ("Amount = Rs. %5.2f\n", p);
printf ("Rate = Rs. %5.2f%\n", r);
printf ("Time = %d years\n", t);
printf ("Simple interest = %5.2f\n", si);
}
int main()
{
int p,n,count;
float r,si;
count=1;
while(count<=3)
{
printf("\n enter values of p,n,andr");
scanf("%d %d %f",&p, &n, &r);
si=(float)p * (float)n * r / 100;
printf("simple interest =rs. %f",si);
count=count+1;
}
return(0);
}
#include<iostream>
#include<sstream>
#include<type_traits>
using namespace std;
double simple_interest (double principal, double interest_rate, unsigned term) {
double interest = 0;
for (unsigned year=0; year<term; ++year)
interest += (principal + interest) * interest_rate / 100;
return interest;
}
template<typename T>
T input_value (string prompt, T range_min, T range_max) {
static_assert (is_arithmetic<T>::value, "Arithmetic type expected");
T value;
string str;
stringstream ss;
while (true) {
cout << prompt << " [" << range_min << ':' << range_max << "]: ";
cin >> str;
ss << str;
if (ss>>value)
if (value<range_min range_max<value)
cerr << "Error: value out of range";
else
break;
}
return value;
}
int main() {
cout << "Simple Interest Calculator\n";
double principal {input_value<double> ("Enter the principal amount", 0, 1000)};
double rate {input_value<double> ("Enter the annual interest rate", 0, 100)};
unsigned term {input_value<unsigned> ("Enter the term of investment", 0, 25)};
double interest {simple_interest (principal, rate, term)};
cout << "Simple interest over a " << term << " year period: " << interest << endl;
}
Example output:
Simple Interest Calculator
Enter the principal amount [0:1000]: 1000
Enter the annual interest rate [0:100]: 10
Enter the term of investment [0:25]: 5
Simple interest over a 5 year period: 610.51
cout<<wat de hell is cookin man<<
Using parameters argc and argv, and library functions fopen, fprintf, fclose
yes
Here is an example program: class obj{ public: float p,n,r,si; friend void calc( obj temp); }; void calc( obj temp){ si = (p*n*r)/100; } The initialization and function calling is essential.
i want to write a simple without using pointer or array c program which will print greatest number when i give 20 number .........How far have you gotten so far?
In the Options menu the Arguments command.
Not used
Using simple interest is easier for people to understand. Customers will be able to manage their payments if a business uses simple interest.
find the interest on $4000 at 3.5% annual interest for 1 year 6 months
Using parameters argc and argv, and library functions fopen, fprintf, fclose
yes
Simple Interest
That would also depend on the interest rate, and whether you are using simple or compound interest.
time= interest/principal x rate likee yeahh thats it
Here is an example program: class obj{ public: float p,n,r,si; friend void calc( obj temp); }; void calc( obj temp){ si = (p*n*r)/100; } The initialization and function calling is essential.
Arguments using numbers to prove their point.
It depends on the rewards program a person is using. For example, a credit card might have rewards, but then the interest one is paying will not make it worth it.
Well, this is a very open question, please be specific, I will try try to answer this as well, a simple c language program can be any thing from printing your name on the screen to printing some patterns using symbols, or making a small game, or a simple calculator program. you can a clearer picture of what can be a simple c language program here: