Showing posts with label Find Out Simple Interest using Class. Show all posts
Showing posts with label Find Out Simple Interest using Class. Show all posts

Saturday, 28 January 2012

Program To Find Simple Interest Using C


#include<stdio.h>
#include<conio.h>
#include<math.h>
main()
{
float p,n,r,ci,x,y,a;
clrscr();
printf("Enter p=");
scanf("%f",&p);
printf("Enter r=");
scanf("%f",&r);
printf("Enter n=");
scanf("%f",&n);
x=(1+r/100);
y=pow(x,n);
a=p*y;
ci=a-p;
printf("%f",ci);
getch();
}

Sunday, 15 January 2012

Program To Find Simple Interest Using Class In C++


  #include<iostream.h>
    #include<conio.h>
    #include<math.h>
    class pawan
      {
private:
float x,y,z;
public:
{
x=p;
y=q;
z=r;
}
void display()
 {
float m,l,j,k;
m=(l*j*k/100);
cout<<m;
   }
     };
    main()
{
pawan a1;
clrscr();
float a,b,c;
cout<<"entaer numbers x,y,z=";
cin>>a>>b>>c;
a1. getdata(a,b,c);
a1.display();
getch();
}

Program To Find Out Simple Interest Using Class In C++

     #include<iostream.h>
#include<conio.h>
#include<math.h>
class pawan
{
private:
float p,r,t;
public:

void getdata(float m,float n,float o)
{
 p=m;
 r=n;
 t=o;

}
void display()
{
float s,u,w,x,y;
s=(1+r/100);
u=p*t;
w=u-p;
cout<<w;
   }
   };
   main()
   {
   pawan a1;
   clrscr();
   float d,e,f;
   cout<<"enter numbers p,r,t=";
   cin>>d>>e>>f;
   a1.getdata(d,e,f);
   a1.display();
   getch();
   }