find simple interest & compund interest

Answers were Sorted based on User's Feedback



find simple interest & compund interest..

Answer / chakkra

#include<stdio.h>
#include<conio.h>
main()
{
float p,n,r,samt=0,camt=0;
printf("enter the principle, no. of years & rate of
interest");
scanf("%f %f %f",&p, &n, &r);
if(p>0&& n>0&& r>0)
{
samt=(p*n*r)/100;
camt=p(1+r/100)^n;
printf("simple interest amount:%f",samt);
printf("compound interest amount:%f",camt);
}
}

Is This Answer Correct ?    8 Yes 6 No

find simple interest & compund interest..

Answer / praveen kumar singh

#include<stdio.h>
#include<conio.h>
#include<math.h>
void main()
{
float p,n,r,si,ci;
printf("enter the value of p,n,r");
scanf("%f%f%f",&p,&n,&r);
si=p*n*r;
ci=p*(1+r/100)^n;
printf("si and ci is%f%f",si,ci);
getch();
}

Is This Answer Correct ?    5 Yes 5 No

Post New Answer

More C Code Interview Questions

void main() { while(1){ if(printf("%d",printf("%d"))) break; else continue; } }

1 Answers  


To Write a C program to remove the repeated characters in the entered expression or in entered characters(i.e) removing duplicates.

19 Answers   Amazon, BITS, Microsoft, Syncfusion, Synergy, Vector,


Write a C program that defines a 2-dimentional integer array called A [50][50]. Then the elements of this array should randomly be initialized either to 1 or 0. The program should then print out all the elements in the diagonal (i.e. a[0][0], a[1][1],a[2][2], a[3][3], ……..a[49][49]). Finally, print out how many zeros and ones in the diagonal.

2 Answers  


Ramesh’s basic salary is input through the keyboard. His dearness allowance is 40% of basic salary, and house rent allowance is 20% of basic salary. Write a program to calculate his gross salary.

1 Answers  


can u give me the c codings for converting a string into the hexa decimal form......

1 Answers  






typedef struct error{int warning, error, exception;}error; main() { error g1; g1.error =1; printf("%d",g1.error); }

1 Answers  


void ( * abc( int, void ( *def) () ) ) ();

1 Answers  


What is full form of PEPSI

0 Answers  


main() { int i=3; switch(i) { default:printf("zero"); case 1: printf("one"); break; case 2:printf("two"); break; case 3: printf("three"); break; } }

1 Answers  


main() { int i=10,j=20; j = i, j?(i,j)?i:j:j; printf("%d %d",i,j); }

2 Answers   Adobe, CSC,


int swap(int *a,int *b) { *a=*a+*b;*b=*a-*b;*a=*a-*b; } main() { int x=10,y=20; swap(&x,&y); printf("x= %d y = %d\n",x,y); }

1 Answers  


int a = 10 + 10 .... ,... A = A * A What would be the value of A? The answer is 120!! Could anyone explain this to me.

2 Answers   Bosch, eInfochips, HCL, IHCL,


Categories