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

C with thread , #I have assignment c with unix thread multiplication progr...

#I have assignment c with unix thread multiplication program ..

Program, superposition of waves

superposition of waves

Project, Project Overview A certain financial institution (bank) wishes to ...

Project Overview A certain financial institution (bank) wishes to promote its new business products/services by conducting road shows in rural areas. Their aim is to encourage peop

What does extern "c" int func(int *, A: This will turn o_ "name mangling" f...

A: This will turn o_ "name mangling" for func so that one can connect to code compiled by a C compiler.

Float number, We can combine more than one variable on the same line i.e. ...

We can combine more than one variable on the same line i.e.   float number1,number2,number3; etc Sometimes we want to mix the variable types used on the same line, this could

Oop, define a class for student

define a class for student

Example., I need the c++ program of class bank accout including balance,rat...

I need the c++ program of class bank accout including balance,rate of interests

program to conduct timber structural component design, The question descri...

The question description: You are required to make a C++ program to conduct timber component (beam and column) structural design according to EC5 (all the relevant design codes

Integration, Write a program to find the area under the curve y = f(x) betw...

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

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