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 program to find the compound interest

#include<stdio.h>

#include<conio.h>

void main()

{

float principal,netamount,rate,ci;

int time,year=1;

clrscr();

printf("Enter the principal time and rate of interest\n");

scanf("%f%d%f",&principal,&time,&rate);

netamount=principal;

while(year<=time)

{

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

year++;

}

ci=netamount-principal;

printf("Compound Interest=%f\n",ci);

printf("Net amount=%f",netamount);

getch();

}

Output:

Enter the principal time and rate of interest

1000                                                                           

5                                                                              

8                                                                               

Compound Interest=469.328125                                                   

Net amount=1469.328125  

Write a program to find the compound interest Write a program to find the compound interest Reviewed by Vision Academy on December 08, 2021 Rating: 5

No comments:

Powered by Blogger.