/*calculation of simple interest*/ #include<stdio.h> /*#include is a preprocessor directive and #include<stdio.h> is a declaration for printf() function*/ int main() /*main() is a function or a cointainer for a set of statements*/ { int p,n; /*declaration*/ float r,si; /*declaration*/ p=50000; //p=principal n=10; //n=number of years r=2500; //r=rate si=p*n*r/100; //using formula for simple interest printf("%f\n",si); /*printf() displays output on the screen, %f is used to print real value, and \n takes cursor to next line*/ return 0; /*as we are using int before main(), it return a value 0*/ } In the above program, Every time we run the program we...
Comments
Post a Comment
Please do not enter any spam link in the comment box.