/* Calculate Simple interest */
#include<stdio.h>
int main()
{
float p;
float ir,t;
float in;
printf("Type your principle amount : ");
scanf("%f",&p);
printf("\n Type your rate of intrest : ");
scanf("%f",&ir);
printf("\n Type time (in year) : ");
scanf("%f",&t);
in=p*ir*t/100;
printf("\n You will get intrest : %.2f",in);
return 0;
}
#include<stdio.h>
int main()
{
float p;
float ir,t;
float in;
printf("Type your principle amount : ");
scanf("%f",&p);
printf("\n Type your rate of intrest : ");
scanf("%f",&ir);
printf("\n Type time (in year) : ");
scanf("%f",&t);
in=p*ir*t/100;
printf("\n You will get intrest : %.2f",in);
return 0;
}
your doc is very useful!!! Appreciate for the details about the C Programing. its very helpfull for learning a gud programing using C.
ReplyDeleteThanks for ur afferts Nimish.
printf("\n You will get intrest : %.2f",in);
ReplyDeletein this line y we using %.2f
can u explain it
it means that we will be showing 2 digits after decimal.
Deletert
Deleteis that %.2f or %2f
ReplyDeleteit is %.2f
Deletethanks sir for this programme
ReplyDeleteNice article admin thanks for share your atricle keep share your knowledge i am waiting for your new post check mens winter jackets polo shirts kindly review and reply me
ReplyDelete