View Feed
group-icon
Coffee Room
Discuss anything here - everything that you wish to discuss with fellow engineers.
12939 Members
Join this group to post and comment.
Dhruti
Dhruti • Oct 30, 2009

C or C++ codefor a scientific or graphing calculator

hey guys!!
i need the code for a scientific or graphing calculator in c or c++. please help!!
and also suggest me with a topic for embedded technology
gaurav.bhorkar
gaurav.bhorkar • Oct 31, 2009
Re: c or c++ code

Dhruti
hey guys!!
i need the code for a scientific or graphing calculator in c or c++. please help!!
and also suggest me with a topic for embedded technology
Please post whatever you have tried to code. The CEans will help you.
Kaustubh Katdare
Kaustubh Katdare • Oct 31, 2009
Re: c or c++ code

For the topics look here: Project Ideas & Seminar Topics - CrazyEngineers Forum
madhumurundi
madhumurundi • Nov 1, 2009
hi,
i have done the project on Calculator in Graphics its so interesting and Attractive ... just copy the code
#include
#include
#include
#include
#include
#include
#include
#include
    class figurecal
         {
     public:
    char ch1,ch,ch2,ch3,ch4;
    char ans;
    int a,b,c,res,cir,cho,cu,cub,con,cyl,sph,y0,l;
    int color;
    int bottom1;
    int midx, midy;
    int stangle , endangle;
    int xradius,yradius;
    int x1,y1;
    int left,top,right,bottom;
    int a1,a2,a3,a4,b1,b2,b3,b4;
    float x,y,z,d,w,side,area,pm,len,bre,rad,circum;
    float sector,segment,rho,g,par,base,h,angle,arc,rad1,rad2,sh;
    float d1,d2,vol;
    float root1,root2,disc,s;
    long double lo;
     };
//        **        //
float addi(int a,int b);
float sub(int a,int b);
float mult(int a,int b);
float divi(int a,int b);
float rem(int a ,int b);
float disc(int a,int b,int c);
float roots(int a,int b,int disc);
//        **          //
float tri_roc(int a,int b,int c,int d);
float c_a1(int a);
float c_a2(int a);
float area(int a,int b);
float area(int a,int b,int c);
float peri(int a,int b);
float peri(int a,int b,int c);
float diag(int a,int b);
float circum1(int a);
float circum2(int a);
float rh_side(int a,int b);
float trap_area(int a,int b,int c);
float circ_sec(int a,int b);
float circ_arc(int a,int b);
//        **        //
float cu_vol(int a,int b,int c);
float cu_sa(int a,int b,int c);
float cu_diag(int a,int b,int c);
float cyl_vol(int a,int b);
float cyl_sa(int a,int b);
float cyl_csa(int a,int b);
float ho_cyl_vol(int a1,int a2,int b);
float ho_cyl_sa(int a1,int a2,int b);
float ho_cyl_csa(int a1,int a2,int b);
float con_vol(int a,int b);
float con_sa(int a,int b);
float con_csa(int a,int b);
float sph_vol(int a);
float sph_sa(int a);
float sem_sph_sa(int a);
float sem_sph_vol(int a);
float sem_sph_csa(int a);
void main()
{
clrscr();
figurecal o;
int gdriver=DETECT,gmode;
initgraph(&gdriver,&gmode,"c:\\tc\\bin\\bgi");
o.color=0;
o.bottom1=0;
o.stangle = 0, o.endangle = 360;
o.xradius = 280, o.yradius = 180;
delay(1100);
for(;o.bottom1<=470;o.bottom1++)
 {
 setcolor(12);
 delay(6);
 rectangle(0,10,650,o.bottom1);
 }
   o.midx = getmaxx() / 2;
   o.midy = getmaxy() / 2;
   setcolor(10);
   setbkcolor(12);
 for(o.x1=160,o.y1=0;o.y1<190;o.y1++,o.color++)
  {
  delay(12);
  cleardevice();
  setcolor(o.color);
  settextstyle(4,0,7);
  outtextxy(o.x1,o.y1,"WELCOME");
  }
 for(;o.xradius>131,o.yradius>81;o.xradius--,o.yradius--,o.color++)
   {
   setcolor(o.color);
   ellipse(o.midx, o.midy, o.stangle, o.endangle,o.xradius, o.yradius);
   delay(20);
   cleardevice();
   settextstyle(4,0,7);
   outtextxy(160,190,"WELCOME");
   }
   setbkcolor(4);
   setcolor(14);
   settextstyle(4,0,7);
   outtextxy(160,190,"WELCOME");
delay(3400);
clrscr();
setbkcolor(4);
settextstyle(4,0,4);
outtextxy(80,30,"Project On:");
for( o.w=15;o.w>0;o.w--)
{
settextstyle(4,0,7);
setcolor(o.w);
delay(300);
outtextxy(50,100,"Scientific Calculator");
}
setcolor(14);
sound(900);
delay(300);
nosound();
sound(1100);
delay(270);
nosound();
sound(1200);
settextstyle(6,0,2);
outtextxy(50,400,"Guided by: Mr.Sanjay Ojha sir");
delay(270);
nosound();
delay(300);
sound(1200);
delay(270);
nosound();
sound(1100);
delay(180);
nosound();
sound(900);
delay(270);
nosound();
sound(800);
delay(270);
nosound();
delay(200);
sound(800);
delay(270);
nosound();
settextstyle(6,0,2);
outtextxy(50,430,"Project by: MADHU M P .. [EMAIL="madhumurundi@gmai.com"]madhumurundi@gmai.com[/EMAIL]");
delay(500);
sound(1200);
delay(270);
nosound();
delay(200);
sound(1200);
delay(270);
nosound();
sound(1100);
delay(270);
nosound();
sound(900);
delay(270);
nosound();
sound(800);
delay(270);
nosound();
delay(200);
sound(800);
delay(270);
nosound();
delay(400);
sound(900);
delay(230);
nosound();
sound(300);
delay(200);
nosound();
getch();
cout<<"\n\n\n\n\n";
again:
cleardevice();
setcolor(14);
setbkcolor(5);
settextstyle(6,0,4);
outtextxy(140,45,"Select one of the following");
cout<<"\n\n\n\n\t\t1)Basic calculations(+,-..) \n\n\t\t2)2-D figures \n\n\t\t3)3-D figures\n\n\t\t4)Other trignometric & log functions\n\n\t\t5)Exit";
cout<<"\n\n\n\n\n\t\tPlease enter your choice: ";
cin>>o.ch;
clrscr();
cleardevice();
switch(o.ch)
{
 case '1':
 //basic:
 settextstyle(6,0,4);
 outtextxy(70,50,"Welcome to basic arithmetic calculations");
 cout<<"\n\n\n\n\n\n\n\t\t1)Addition\n\n\t\t2)Substraction\n\n\t\t3)Multiplication\n \n\t\t4)Division\n\n\t\t5)Remainder\n\n\t\t6)Roots of quadratic equation \n\n\t\t7)Exit\n\n\t\t Enter your choice:";
 cin>>o.ch1;
 clrscr();
 cleardevice();

   switch(o.ch1)
      {
    case'1':
    settextstyle(10,0,9);
    outtextxy(500,20,"+");
    settextstyle(6,0,5);
    outtextxy(120,30,"Addition");
    cout<<"\n\n\n\n\n\n\n\t\tEnter two numbers(use space to seperate no.s):";
    cin>>o.a>>o.b;
    o.res=addi(o.a,o.b);
    cout<<"\n\n\n\t\tThe sum is "<>o.a>>o.b;
    o.res=sub(o.a,o.b);
    cout<<"\n\n\t\t The difference is"<>o.a>>o.b;
    o.res=mult(o.a,o.b);
    cout<<"\n\t\t The product is "<>o.a>>o.b;
    if(o.b==0)
        {    cout<<"\n\t\t Divide by zero error!!";
            goto repeat;
        }
    else
        {
        o.res=divi(o.a,o.b);
        cout<<"\n\t\t The result is "<>o.a>>o.b;
    if(o.b==0)
           { cout<<"\n\t\t Divide by zero error!!";
         goto repeat;
           }
    else
        {
        o.res=rem(o.a,o.b);
        cout<<"\n\t\t The result is "<>o.a>>o.b>>o.c;
        if(o.a==0)
         {cout<<"\n\t\tValue of a should not be zero";
         getch();
         goto repeat;
         }
        else
         {
         o.disc=disc(o.a,o.b,o.c);
          if(o.disc>0)
           {
        o.root1=roots(o.a,o.b,o.disc);
        o.root2=roots(o.a,o.b,o.disc);
        cout<<"\n\t\tRoots are real and unequal\n\t\t";
        cout<<"Root1 = "<>o.ch2;
  clrscr();
  cleardevice();
  switch(o.ch2)
   {
     case'1':
     for( o.a1=100,o.a2=200,o.a3=200,o.a4=100,o.b1=200,o.b2=200,o.b3=300,o.b4=300;o.a1<475,o.a2<575,o.a3<525,o.a4<425;o.a1++,o.a2++,o.a3++,o.a4++)
     {
     cleardevice();
     line(o.a1,o.b1,o.a2,o.b2);
     line(o.a2,o.b2,o.a3,o.b3);
     line(o.a1,o.b1,o.a4,o.b4);
     line(o.a3,o.b3,o.a4,o.b4);
     delay(10);
     }
     settextstyle(6,0,5);
     outtextxy(130,30,"Square");
     cout<<"\n\n\n\n\n\n\t\t1)Area\n\n\t\t2)Perimeter\n\n\t\t3)Diagonal\n\n\t\t4)Exit";
     cout<<"\n\n\t\tEnter your choice:";
     cin>>o.cho;
     if(o.cho==1)
      {
      cout<<"\n\t\tEnter the length of side:";
      cin>>o.side;
      o.area=area(o.side,o.side);
      cout<<"\n\t\tThe area is "<>o.side;
     o.pm=peri(o.side,o.side);
     cout<<"\n\t\tThe perimeter is "<>o.side;
     o.d=diag(o.side,o.side);
     cout<<"\n\t\tThe length of diagonal is "<>o.cho;
     if(o.cho==1)
     {
         cout<<"\n\n\t\tEnter the length and breadth:";
         cin>>o.len>>o.bre;
         o.area=area(o.len,o.bre);
         cout<<"\n\n\t\tThe area is "<>o.len>>o.bre;
     o.pm=peri(o.len,o.bre);
     cout<<"\n\n\t\tThe perimeter is "<>o.len>>o.bre;
     o.d=diag(o.len,o.bre);
     cout<<"\n\n\t\tThe length of diagonal is "<>o.cho;
     if(o.cho==1)
     {
     cout<<"\n\n\t\tEnter the sides a,b &c:";
     cin>>o.x>>o.y>>o.z;
     o.area=area(o.x,o.y,o.z);
     cout<<"\n\n\t\tThe area is "<>o.a>>o.b>>o.c;
     o.pm=peri(o.a,o.b,o.c);
     cout<<"\n\n\t\tThe perimeter is "<>o.x>>o.y>>o.z;
     o.s=(o.x+o.y+o.z)/2;
     o.area=area(o.x,o.y,o.z);
     o.rad= o.area/o.s;
     cout<<"\n\n\t\tThe radius of incircle is "<>o.x>>o.y>>o.z;
     o.s=(o.x+o.y+o.z)/2;
     o.area=area(o.x,o.y,o.z);
     o.rad=tri_roc(o.x,o.y,o.z,o.area);
     cout<<"\n\n\t\tThe radius of circumcircle is "<>o.cho;
     if(o.cho==1)
     {
     cout<<"\n\n\t\tEnter the length of base and height:";
     cin>>o.base>>o.h;
     o.area=area(o.base,o.h);
     cout<<"\n\n\t\tThe area is"<>o.len>>o.bre;
     o.pm=peri(o.len,o.bre);
     cout<<"\n\n\t\tThe perimeter is"<>o.cho;
        if(o.cho==1)
        {
        cout<<"\n\n\t\tEnter the radius of circle:";
        cin>>o.rad;
        o.area=c_a1(o.rad);
        cout<<"\n\n\t\tThe area is "<>o.rad;
        o.circum= circum1(o.rad);
        cout<<"\n\n\t\tThe circumference is "<>o.rad>>o.angle;
        o.arc=circ_arc(o.rad,o.angle);//
        cout<<"\n\n\t\tThe length of arc is "<>o.rad>>o.angle;
        o.sector=circ_sec(o.rad,o.angle);
        cout<<"\n\n\t\tThe area of sector is "<>o.rad>>o.angle;
        o.sector=circ_sec(o.rad,o.angle);
        o.area=0.5*o.rad*o.rad*sin(o.angle);
        o.segment=  o.sector-o.area;
        cout<<"\n\n\t\tThe area of segment is "<>o.cho;
        if(o.cho==1)
        {
        cout<<"\n\n\t\tEnter the radius of semi-circle:";
        cin>>o.rad;
        o.area=(3.14*o.rad*o.rad)/2;
        cout<<"\n\n\t\tThe area is "<>o.rad;
        o.circum=5.14*o.rad;
        cout<<"\n\n\t\tThe circumference is "<>o.cho;
        if(o.cho==1)
        {
        cout<<"\n\n\t\tEnter the length of diagonals:";
        cin>>o.d1>>o.d2;
        o.area=0.5*o.d1*o.d2;
        cout<<"\n\n\t\tThe area is "<>o.side;
        o.pm=4*o.side;
        cout<<"\n\n\t\tThe perimeter is "<>o.d1>>o.d2;
        o.side=rh_side(o.d1,o.d2);
        cout<<"\n\n\t\tThe length of side is "<>o.cho;
        if(o.cho==1)
        {
        cout<<"\n\n\t\tEnter the lengths of parallel sides \n\t\tand distance between them:";
        cin>>o.d1>>o.d2>>o.h;
        o.area=trap_area(o.d1,o.d2,o.h);
        cout<<"\n\n\t\tThe area is "<>o.ch3;
  clrscr();
  cleardevice();
  switch(o.ch3)
   {
    case'1':for(o.a1=0,o.a2=100,o.a3=100,o.a4=0,o.b1=0,o.b2=0,o.b3=100,o.b4=100;o.a1<450,o.a2<550,o.a3<450,o.a4<550,o.b1<250,o.b2<250,o.b3<350,o.b4<350;o.a1+=2,o.a2+=2,o.a3+=2,o.a4+=2,o.b1++,o.b2++,o.b3++,o.b4++)
     {
     cleardevice();
     line(o.a1,200,o.a2,200);
     line(o.a2,200,o.a3,300);
     line(o.a1,200,o.a4,300);
     line(o.a3,300,o.a4,300);
     delay(10);
     line(450,o.b1,550,o.b2);
     line(550,o.b2,550,o.b3);
     line(450,o.b1,450,o.b4);
     line(550,o.b3,450,o.b4);
     delay(11);
     }
     delay(190);
     line(o.a1,200,449,o.b1);
     delay(190);
     line(549,o.b2,o.a2,200);
     delay(190);
     line(449,o.b4,o.a4,300);
     delay(190);
     line(549,o.b3,o.a3,300);
     delay(190);
        settextstyle(6,0,5);
        outtextxy(130,30,"Cube");
        cout<<"\n\n\n\n\n\n\t\t1)Volume\t\t2)Surface area\n\n\t\t3)Diagonal\t\t4)Exit";
        cout<<"\n\n\t\tEnter your choice:";
        cin>>o.cu;
          if(o.cu==1)
        {
        cout<<"\n\n\t\tEnter side:";
        cin>>o.side;
        o.vol=cu_vol(o.side,o.side,o.side);
        cout<<"\n\n\t\tThe volume is "<>o.side;
        o.area=cu_sa(o.side,o.side,o.side);
        cout<<"\n\n\t\tThe surface area is "<>o.side;
        o.d=cu_diag(o.side,o.side,o.side);
        cout<<"\n\n\t\tThe diagonal is "<
 
madhumurundi
madhumurundi • Nov 1, 2009
CONTD.......

[COLOR=Red] case'2':for(o.a1=80,o.a2=210,o.a3=210,o.a4=80,o.b1=0,o.b2=0,o.b3=100,o.b4=100;o.a1<400,o.a2<550,o.a3<550,o.a4<400,o.b1<200,o.b2<200,o.b3<300,o.b4<300;o.a1+=3,o.a2+=3,o.a3+=3,o.a4+=3,o.b1+=2,o.b2+=2,o.b3+=2,o.b4+=2)
     {
     cleardevice();
     line(o.a1,250,o.a2,250);
     line(o.a2,250,o.a3,350);
     line(o.a1,250,o.a4,350);
     line(o.a3,350,o.a4,350);
     delay(10);
     line(410,o.b1,540,o.b2);
     line(540,o.b2,540,o.b3);
     line(540,o.b3,410,o.b4);
     line(410,o.b1,410,o.b4);
     delay(15);
     }
     delay(190);
     line(376,250,410,o.b1);
     delay(190);
     line(540,o.b2,506,250);
     delay(190);
     line(410,o.b4,376,350);
     delay(190);
     line(540,o.b3,506,350);
     delay(190);
        settextstyle(6,0,5);
        outtextxy(130,30,"Cuboid");
        cout<<"\n\n\n\n\n\n\t\t1)Volume\t\t2)Surface area\n\n\t\t3)Diagonal\t\t4)Exit";
        cout<<"\n\n\t\tEnter your choice:";
        cin>>o.cu;
        if(o.cu==1)
        {
        cout<<"\n\n\t\tEnter the sides:";
        cin>>o.a>>o.b>>o.c;
        o.vol=cu_vol(o.a,o.b,o.c);
        cout<<"\n\n\t\tThe volume is "<>o.a>>o.b>>o.c;
        o.area=cu_sa(o.a,o.b,o.c);
        cout<<"\n\n\t\tThe surface area is "<>o.a>>o.b>>o.c;
        o.d=cu_diag(o.a,o.b,o.c);
        cout<<"\n\n\t\tThe diagonal is "<>o.cyl;
         if(o.cyl==1)
        {
        cout<<"\n\n\t\tEnter the radius and height:";
        cin>>o.rad>>o.h;
        o.vol=cyl_vol(o.rad,o.h);
        cout<<"\n\n\t\tThe volume is "<>o.rad>>o.h;
        o.area=cyl_sa(o.rad,o.h);
        cout<<"\n\n\t\tThe total surface area is "<>o.rad>>o.h;
        o.area=cyl_csa(o.rad,o.h);
        cout<<"\n\n\t\tThe curved surface area is "<>o.cyl;
         if(o.cyl==1)
        {
        cout<<"\n\n\t\tEnter the inner and outer radii and height:";
        cin>>o.rad2>>o.rad1>>o.h;
        o.vol=ho_cyl_vol(o.rad2,o.rad1,o.h);
        cout<<"\n\n\t\tThe volume is "<>o.rad2>>o.rad1>>o.h;
        o.area=ho_cyl_sa(o.rad1,o.rad2,o.h);
        cout<<"\n\n\t\tTne total surface area is "<>o.rad2>>o.rad1>>o.h;
        o.area=ho_cyl_csa(o.rad1,o.rad2,o.h);
        cout<<"\n\n\t\tThe curved surface area is "<>o.con;
         if(o.con==1)
        {
        cout<<"\n\n\t\tEnter the radius and height:";
        cin>>o.rad>>o.h;
        o.vol=con_vol(o.rad,o.h);
        cout<<"\n\n\t\tThe volume is "<>o.rad>>o.h;
        o.area=con_sa(o.rad,o.h);
        cout<<"\n\n\t\tThe total surface area is "<>o.rad>>o.h;
        o.area=con_csa(o.rad,o.h);
        cout<<"\n\n\t\tThe curved surface area is "<>o.sph;
         if(o.sph==1)
        {
        cout<<"\n\n\t\tEnter the radius:";
        cin>>o.rad;
        o.vol=sph_vol(o.rad);
        cout<<"\n\n\t\tThe volume is "<>o.rad;
        o.area=sph_sa(o.rad);
        cout<<"\n\n\t\tThe surface area is "<>o.sph;
         if(o.sph==1)
        {
        cout<<"\n\n\t\tEnter the radius:";
        cin>>o.rad;
        o.vol=sem_sph_vol(o.rad);
        cout<<"\n\n\t\tThe volume is "<>o.rad;
        o.area=sem_sph_sa(o.rad);
        cout<<"\n\n\t\tThe total surface is "<>o.rad;
        o.area=sem_sph_csa(o.rad);
        cout<<"\n\n\t\tThe curved surface is "<>o.ch4;
    switch(o.ch4)
     {
     case'1':{
         cout<<"\n\n\t\tEnter the angle:";
         cin>>o.a;
         cout<<"\n\n\t\tThe sin is "<>o.a;
         cout<<"\n\n\t\tThe cos is "<>o.a;
         cout<<"\n\n\t\tThe tan is "<>o.a;
         cout<<"\n\n\t\tThe natural log is "<>o.a;
         cout<<"\n\n\t\tThe log to base 10 is "<>o.a;
         cout<<"\n\n\t\tThe square root is "<>o.a;
         cout<<"\n\n\t\tEnter the power:";
         cin>>o.b;
         cout<<"\n\n\t\tThe result is "<>o.lo;
         cout<<"\n\n\t\tThe absolute value is "<>o.ans;
if(o.ans=='y')
goto again;
else
clrscr();
cleardevice();
setbkcolor(12);
setcolor(14);
for(o.left=0,o.top=0,o.right=640,o.bottom=480,o.y0=0,o.l=0,o.color=0;o.left<149,o.right>501,o.top<149,o.bottom>356;o.left++,o.top++,o.right--,o.bottom--,o.y0+=2,o.l++,o.color++)
{
setcolor(o.color);
rectangle(o.left,o.top,o.right,o.bottom);
delay(40);
settextstyle(4,0,4);
outtextxy(151,147,"************************* ");
outtextxy(151,300,"************************* ");
settextstyle(10,0,4);
outtextxy(170,210,"THANK YOU");
delay(8);
 }
setcolor(14);
settextstyle(4,0,4);
outtextxy(151,147,"************************* ");
outtextxy(151,300,"************************* ");
settextstyle(10,0,4);
outtextxy(170,210,"THANK YOU");
delay(6000);
exit(0);
getch();
}
    // function definations //

float addi(int a,int b)
{
return (a+b);
}
float sub(int a,int b)
{
return (a-b);
}
float mult(int a,int b)
{
return (a*b);
}
float divi(int a,int b)
{
return (a/b);
}
float rem(int a ,int b)
{
return (a%b);
}
float disc(int a,int b,int c)
{
return (b*b -4*a*c);
}
float roots(int a,int b,int disc)
{
return ((-b+sqrt(disc))/2*a);
}
///2d///
float area(int a,int b)
{
return (a*b);
}
float peri(int a, int b)
{
return (2*(a+b));
}
float area(int a,int b,int c)
{
int s;
s=(a+b+c)/2;
return (sqrt(s*(s-a)*(s-b)*(s-c)));
}
float peri(int a,int b,int c)
{
return (a+b+c);
}
float diag(int a,int b)
{
return (sqrt(a*a+b*b));
}
float c_a1(int a)
{
return (3.14*a*a);
}
float c_a2(int a)
{
return  (3.14*a*a*(0.25));
}
float tri_roc(int a,int b,int c,int d)
{
return ((a*b*c)*d/4);
}
float circum1(int a)
{
return (6.28*a);
}
float circum2(int a)
{
return (3.14*a);
}
float rh_side(int a,int b)
{
return  (0.5*(sqrt(a*a+b*b)));
}
float trap_area(int a,int b,int c)
{
return ((a+b)*c/2);
}
float circ_sec(int a,int b)
{
return ((3.14*a*a*b)/360);
}
float circ_arc(int a,int b)
{
return ((3.14*2*a*b)/360);
}
//3d//                      ////////////////////
float cu_vol(int a,int b,int c)
{
return  (a*b*c);
}
float cu_sa(int a,int b,int c)
{
return (2*(a*b+b*c+c*a));
}
float cu_diag(int a,int b,int c)
{
return (sqrt(a*a+b*b+c*c));
}
float cyl_vol(int a,int b)
{
return  (3.14*a*a*b);
}
float cyl_sa(int a,int b)
{
return ((2*3.14*a*a*b) + (2*3.14*a*a));
}
float cyl_csa(int a,int b)
{
return  (2*3.14*a*b);
}
float ho_cyl_vol(int a1,int a2,int b)
{
return  (3.14*b*(a1*a1 - a2*a2));
}
float ho_cyl_sa(int a1,int a2,int b)
{
return  (2*3.14*(a1-a2)*(b+a1+a2));
}
float ho_cyl_csa(int a1,int a2,int b)
{
return (2*3.14*b*(a1-a2));
}
float con_vol(int a,int b)
{
return  ((3.14*a*a*b)/3);
}
float con_sa(int a,int b)
{
return (3.14*a*(a+sqrt(a*a+b*b)));
}
float con_csa(int a,int b)
{
return (3.14*a*(sqrt(a*a+b*b)));
}
float sph_vol(int a)
{
return  ((4*3.14*a*a*a)/3);
}
float sph_sa(int a)
{
return  (4*3.14*a*a);
}
float sem_sph_vol(int a)
{
return ((2*3.14*a*a*a)/3);
}
float sem_sph_sa(int a)
{
return  (3*3.14*a*a) ;
}
float sem_sph_csa(int a)
{
return (2*3.14*a*a);
}
[/COLOR]
Kaustubh Katdare
Kaustubh Katdare • Nov 1, 2009
Wrapped the code in
 .. [ / code] tags.

Share this content on your social channels -