google.com, pub-6167773875660516, DIRECT, f08c47fec0942fa0 Write a program to find the compound interest - 2nd puc computer science

Write a program to find the compound interest

 /*Write a C++ program to input principal amount, rate of interest and time period. Calculate compound interest using while statement.
(Hint: Amount = P * (1 + R/100)T, Compound Interest = Amount - P)*/

#include<iostream.h>

#include<conio.h>

void main( )

{

float priamt,netamt,rate,ci;

int time,year;

clrscr();

cout<<"Enter the Principal amount, rate of interest and time:"<<endl;

cin>>priamt>>rate>>time;

netamt=priamt;

year = 1;

while(year<=time)

{

netamt = netamt*(1 + rate/100);

year ++;

}

ci = netamt - priamt;

cout<<"Compound Interest = "<<ci<<endl;

cout<<"Net Amount = "<<netamt<<endl;

getch( );

}


Write a program to find the compound interest Write a program to find the compound interest Reviewed by Vision Academy on February 27, 2022 Rating: 5

No comments:

CheckOut

Powered by Blogger.