find simple interest & compund interest
Answers were Sorted based on User's Feedback
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 |
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 |
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
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)
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
find A^B using Recursive function
main() { int i=5,j=10; i=i&=j&&10; printf("%d %d",i,j); }
Is this code legal? int *ptr; ptr = (int *) 0x400;
What is "far" and "near" pointers in "c"...?
main(){ unsigned int i; for(i=1;i>-2;i--) printf("c aptitude"); }
#include <stdio.h> #define a 10 main() { #define a 50 printf("%d",a); }
main() { char *p="hai friends",*p1; p1=p; while(*p!='\0') ++*p++; printf("%s %s",p,p1); }
Is the following code legal? void main() { typedef struct a aType; aType someVariable; struct a { int x; aType *b; }; }
main() { int *ptr=(int*)malloc(sizeof(int)); *ptr=4; printf("%d",(*ptr)+++*ptr++); }