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

#include"math.h" void main() { printf("Hi everybody"); } if <stdio.h> will be included then this program will must compile, but as we know that when we include a header file in "" then any system defined function find its defination from all the directrives. So is this code of segment will compile? If no then why?

2 Answers  


main() { extern out; printf("%d", out); } int out=100;

1 Answers  


int DIM(int array[]) { return sizeof(array)/sizeof(int ); } main() { int arr[10]; printf(“The dimension of the array is %d”, DIM(arr)); }

2 Answers   CSC,


String copy logic in one line.

11 Answers   Microsoft, NetApp,


main() { register int a=2; printf("Address of a = %d",&a); printf("Value of a = %d",a); }

3 Answers  






struct aaa{ struct aaa *prev; int i; struct aaa *next; }; main() { struct aaa abc,def,ghi,jkl; int x=100; abc.i=0;abc.prev=&jkl; abc.next=&def; def.i=1;def.prev=&abc;def.next=&ghi; ghi.i=2;ghi.prev=&def; ghi.next=&jkl; jkl.i=3;jkl.prev=&ghi;jkl.next=&abc; x=abc.next->next->prev->next->i; printf("%d",x); }

1 Answers  


1. const char *a; 2. char* const a; 3. char const *a; -Differentiate the above declarations.

3 Answers  


write a program in c to merge two array

2 Answers  


could you please send the program code for multiplying sparse matrix in c????

0 Answers  


write a origram swaoing valu without 3rd variable

2 Answers  


main() { unsigned int i=10; while(i-->=0) printf("%u ",i); }

2 Answers   HP,


Write a C function to search a number in the given list of numbers. donot use printf and scanf

5 Answers   Honeywell, TCS,


Categories