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

Predict the Output: int main() { int *p=(int *)2000; scanf("%d",2000); printf("%d",*p); return 0; } if input is 20 ,what will be print

2 Answers  


Give a very good method to count the number of ones in a 32 bit number. (caution: looping through testing each bit is not a solution)

7 Answers   Microsoft,


main() { int i; clrscr(); for(i=0;i<5;i++) { printf("%d\n", 1L << i); } } a. 5, 4, 3, 2, 1 b. 0, 1, 2, 3, 4 c. 0, 1, 2, 4, 8 d. 1, 2, 4, 8, 16

4 Answers   HCL,


find A^B using Recursive function

2 Answers  


main() { int i=5,j=10; i=i&=j&&10; printf("%d %d",i,j); }

1 Answers  






Is this code legal? int *ptr; ptr = (int *) 0x400;

1 Answers  


What is "far" and "near" pointers in "c"...?

3 Answers  


main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }

2 Answers  


#include <stdio.h> #define a 10 main() { #define a 50 printf("%d",a); }

2 Answers  


main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); }

3 Answers  


Is the following code legal? void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }

1 Answers  


main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }

3 Answers   GNITC,


Categories