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

What is class definition, Class Definition The following is the general...

Class Definition The following is the general format of defining a class template: class tag_name                  {                    public  :               // Must

Define scope rules of c program - computer programming, Define Scope Rules ...

Define Scope Rules of C program - Computer Programming? The fundamental rule of scope is that identifiers are accessible only within the block in which they are declared and th

Prepare windows shell extension, Prepare Windows Shell Extension Project...

Prepare Windows Shell Extension Project Description: Skills required are C++ Programming, Windows Desktop, Windows API

Program for hangman game problem, Program for Hangman Problem   #inclu...

Program for Hangman Problem   #include   #include   #include   #include   #include   static void playGame();   static void printMistakes(int n);   st

Program of conversion from basic to user-defined variable, Conversion from ...

Conversion from Basic to User-Defined variable Consider the following example. class Distance                  {                   public  :

OpenGL configured environment, 1. Using Visual C++ and your OpenGL co...

1. Using Visual C++ and your OpenGL configured environment, write an application that displays a “unique” graphical scene that you designed and coded for this course. What yo

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

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

PEBBLE MERCHANT, There is a pebble merchant. He sells the pebbles, that are...

There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometimes mistakes doing that

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