programme to calculate SI


Hey Guys, today I will let you know how to write a  C-Programe to calculate the Simple Interest when Principal, Rate and time are given. The very first thing that you need to understand is  that there are different IDE's for writting and executing C-Programe. Suppose if you are writting a C-Programe in Turbo C++ , and the same programe you are writing in some others IDE's like DEV C++,Code blocks,etc you find there is slight difference in the programe that you have written in Turbo C++ and the one you have written in DEv C++. Here i will write the programes for both. So let's get started.

FOR TURBO C++  :-


               #include<stdio.h>
               #include<conio.h>
               void main()
               {
                 float P,R,T,SI;
                 clrscr();
                  printf("Enter the value of P,R, and T");
                  scanf("%f%f%f", &P,&R,&T);
                  SI=(P*R*T)/100;
                  printf(" The Simple Interesr =Rs. %f",SI);
                 getch();
                }

Here, clrscr() is a predefined function in #include<conio.h>  which is used to erase the previous output and give the fresh output every time you run the code.

FOR DEVC++  :-


               #include<stdio.h>
               #include<conio.h>
               main()
               {
                 float P,R,T,SI;
                  printf("Enter the value of P,R, and T");
                  scanf("%f%f%f", &P,&R,&T);
                  SI=(P*R*T)/100;
                  printf(" The Simple Interesr =Rs. %f",SI);
                 getch();
                }
Here, clrscr() will not work and also intead of using void main here we will use only main() or int main(),


                               THANK YOU!!

1 comment:

  1. Awesome Information Regarding The Novels. A very Nice And a very Good stuff. Madhuranjank

    ReplyDelete