source code, C/C++ Programming

Assignment Help:
I hv an assignment to do, I almost done. But i cant find whats wrong- my code is to make a simple calculator using function''s all 4 patterns. I did like this-

#include
int add (int, int);
int sub (void);
void mul (int, int);
void div (void);
int main()
{
int add, sub, mul, x, y;
float div;
printf("Enter the 1st number: ");
scanf("%d", &x);
printf("Enter the 2nd number: ");
scanf("%d", &y);
add;
{
printf("the sum is %d",add(x,y));
}
sub;
{
printf("the substraction is %d", sub());
}
mul(x,y);
div();
return 0;
}
int add (int x, int y)
{
int add;
add=x+y;
return add;
}

int sub (void)
{
int sub, x, y;
sub= (x-y);
return sub;
}

void mul (int x, int y)
{
int mul;
mul=(x*y);
printf("the product result is%d",mul);
}

void div (void)
{
int x, y;
float div;
div=(x/y);
printf("the division result is %f",div);
}


Related Discussions:- source code

Area under curve, write a program to find the area under the curve y=f(x) b...

write a program to find the area under the curve y=f(x) between x=a and x=b integrate y=f(x) between the limits of a and b #include float start_point,

C programming assignment, good night i have an assignment that i really nee...

good night i have an assignment that i really need help with. i have to create a struct file with tag name book to have members int book_id char isbn[255]

Program to input 2 date & produce a new date - c++ program, /*  THIS PROGRA...

/*  THIS PROGRAM IS TO ASK USER TO INPUT TWO DATE & PRODUCE A NEW DATE  */ #include #include struct date  {   int dd;   int yy;   int mm;  }; date add(date d1,date d2)    {

Define static storage class - computer programming, Define Static Storage C...

Define Static Storage Class in C Programming? The Static declarations have distinct and important uses. This allows the local variable to keep its previous value when the block

Refactoring, Refactoring Project Description: TASK 1 - DESIGN ALGORIT...

Refactoring Project Description: TASK 1 - DESIGN ALGORITHM You are required to design a suitable solution algorithm by using structured chart, pseudocode or flowchart. Thi

C++ ASSIGNMENT, How much does it cost to complete a C++ assignment that is ...

How much does it cost to complete a C++ assignment that is 80% finished??

Can i explicitly call a destructor if i''ve allocated my , Can I explicitly...

Can I explicitly call a destructor if I've allocated my object with new?

Decode, Problem Description Smugglers are becoming very smart day by day. N...

Problem Description Smugglers are becoming very smart day by day. Now they have developed a new technique of sending their messages from one smuggler to another. In their new techn

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd