Kitab O Sunnat

Saturday, March 13, 2010

calculiter codes of TC

#include
#include
#include
int add(int,int);
int sub(int,int);
int mul(int,int);
int divide(int,int);
int mod (int,int);
int fac(int,int);
int square(int,int);
int cube(int,int);
int power(int,int);
int squrt(int,int);
void main(void)
{
int op;
printf("enter 1 for add");
printf("enter 2 for sub");
printf("enter 3 for mul");
printf("enter 4 for divide");
printf("enter 5 for mod");
printf("enter 6 for fac");
printf("enter 7 for square");
printf("enter 8 for cube");
printf("enter 9 for power");
printf("enter 10 for squrt");
scanf("%d",&op);
switch (op)
{
case 1:
int x,y;
printf("enter the values ....");
scanf("%d%d,&x,&y");

add(x,y);
break;
case 2:
printf("enter the no to be sub...");
scanf("%d%d.&x,&y");
sub(x,y);
break;
case 3:
printf("enter the values to mul ...");
scanf("%d%d.&x,&y");
mul(x,y);
break;
case 4:
printf("enter the values.....") ;
scanf("%d%d.&x,&y");
divide(x,y);
break;
case 5:
printf("enter the values...");
scanf("%d%d,&x,&y");
mod (x,y);
break;
case 6:
printf("ents=er the value..");
scanf("%d,&x");
fact(x);
break;
case 7:
int x;
printf("enter the value ...");
scanf("%d,&x");
square(x);
break;
case 8:
int x;
printf("enter the values...");
scanf("%d,&x");
cube(x);
break;
case 9:
int x;
printf("enter the values....");
scanf("%d,&x");
sqrt(x);
break;
default;
printf("you have enter the rong statment");

}
getch();
}

No comments:

NEOBUX

http://www.neobux.com/?r=taahaijaz