RE: [Dev-C++] errors in devc++ with no visible cause
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: Graeme F. <gr...@dr...> - 2001-08-04 07:42:56
|
Add a semicolon after the line...
result = x *y
and add a close brace after the return result; but before the int main()
next add a semicolon to the end of the line that declares answer and the
line that assigns a value into it. Add a comma between the quoted text and
the variable answer in the printf statement and then it should work.
However if you wish to see your output ass a system("pause"); statement
before the return statement in the main function. This function will require
you to add #include <stdlib.h> at the top of the programme.
So the finished programme should be...
#include <stdio.h>
#include <stdlib.h>
//this is the start of excersize 3.3
int multiply(int x, int y)
{
int result;
result = x * y;
return result;
}
int main()
{
int answer;
answer = multiply(3, 5);
printf ("the multiplication answer to 3 and 5 is%d.\n", answer);
system("pause");
return 0;
}
Now you just need to correct the spelling, formatting and indentation...
Cheers,
|