source code, C/C++ Programming

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-

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);
printf("the sum is %d",add(x,y));
printf("the substraction is %d", sub());
return 0;
int add (int x, int y)
int add;
return add;

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

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

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

Posted Date: 7/15/2012 10:54:08 AM | Location : United States

Related Discussions:- source code, Assignment Help, Ask Question on source code, Get Answer, Expert's Help, source code Discussions

Write discussion on source code
Your posts are moderated
Related Questions
i need a program for finding the last fibonacci number

Question : (a) (i) What is a structure member in C? What is the relationship between a structure member and the structure? (ii) How can structure variables be declared in C?

I need whatsapp software in my website Project Description: i need whatsapp software in my website same this whatsapp if anyone can make to me this in my website Skills

P o i n t e r d e c l a r a t i o n f o r me m b e r f un c t i o n : M e t h o d 1 : W h e n C l a ss i s n o t

c++ coding decode the letters from numbers

What is a hash function? Hash function: This is the method from the set 'K' of keys into the set 'L' of memory addresses.   H: K → L These are used to verify the address

i need a detailed c program to explain the parameters of bernoulli''s equation..

write a c program that multiplies 3 martices

Given an char variable last that has been initialized to a lowercase letter, write a loop that displays all possible combinations of two letters in the range ''a'' through last. Th