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

Need programmer to program a flex pcb, Project Description: I want a per...

Project Description: I want a person who will be able to program a flex PCB for my device as i meet the person i will be able to describe all my needs Skills required are C P

Read writers problem, Readers Writers with Processes and Threads Write two ...

Readers Writers with Processes and Threads Write two programs implementing ``reader pritority readers-writers synchronization'''' on files. One program will use processes, created

C program to returns the string, Program is to take two arguments and retur...

Program is to take two arguments and returns the string: Program is to take two arguments and returns the string which is larger the larger string has larger ascii value invok

Change to palindrome, A palindrome is a string that reads the same from bot...

A palindrome is a string that reads the same from both the ends. Given a string S convert it to a palindrome by doing character replacement. Your task is to convert S to palindrome

Write down the class listnode, Question: (a) Write down the class 'Li...

Question: (a) Write down the class 'ListNode' to contain the following:- (i) variable data of type Object (ii) variable next of type ListNode (iii)

AREA UNDER CURVE, Write a program to find the area under the curve y = f(x)...

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. The area under a curve between two points can b

Program Preprocessor variable postfix , Run the following C++ program with ...

Run the following C++ program with and without preprocessor variable POSTFIX defined. #include using namespace std; extern "C" int atoi( const char *str );

Create cpp code for identify objects and their relationships, You are setti...

You are setting up an information system for a DVD Rental Company called Box office. The new system need to hold information about customers and DVDs rentals, payments and fines. C

Assignment, manupulates operator precidence

manupulates operator precidence

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