473,395 Members | 1,583 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

declaration terminated incorrectly... what could be the problem?

Hi! I'm new in turbo C... and I'm trying to make a Program to calculate the product of two numbers.
please help me! I'm using Turbo C v3.0

this error occured:
25:Declaration terminated incorrectly

Expand|Select|Wrap|Line Numbers
  1. #include<stdio.h> 
  2.  
  3. int a, b, c;                                                                 
  4. int product (int x, int y);                                                   
  5.  
  6. main()                                                                        
  7. {                                                                            
  8. //input first number                                                          
  9. printf("enter a number between 1 and 100: ");                               
  10. scanf("%d", &a);                                                                                                              
  11.  
  12. //input second number                                                         
  13. printf("enter another number between 1 and 100: ");                           
  14. scanf("%d", &b);                                                              
  15.  
  16. c = product(a, b);                                                            
  17.  
  18. printf ("%d times %d = %d\n", a, b, c);                                   
  19.  
  20. return 0;
  21. }                                                        
  22.  
  23. int product( int x, int y);                                                   
  24.  
  25. {                                                                             
  26. return (x * y);                                                               
  27. }                                                       
  28.  
Aug 11 '11 #1
1 1748
Rabbit
12,516 Expert Mod 8TB
Remove the semicolon in the function declaration.
Aug 11 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

13
by: Wolfgang Kaml | last post by:
Hello All, I have been researching newsgroups and knowledgebase all morning and not found a solution that would solve the problem I have. I am having an ASP or ASPX web page that implement a...
2
by: Thomas Matthews | last post by:
Hi, I'm getting linking errors when I declare a variable in the global scope, but not inside a function. The declarations are the same (only the names have been changed...). class Book {...
5
by: Jacky Yuk | last post by:
Hi all, I am new to c++ but using c for long time. Recently, I created a MFC GUI project by VC/C++ 6.0. Everything was fine until I wanted to use "template": template <typename T> class...
5
by: Alexis | last post by:
Hello, I have a set of classes I created from schema files using the xsd.exe tool. I'm using namespaces in the clases ( I had to because I have some classes with the same name but not the same...
0
by: ClimberBear | last post by:
Hi, I've got a very strange problem with a Websphere 5.1 cluster attached to DB2 database in Mainframe z/OS. I have a J2EE deployed application running normally fine agains the DB2 host. But,...
9
by: Michael Mair | last post by:
Hello, in C89 (at least in the last public draft), "3.6.2 Compound statement, or block", we have ,--- | Syntax | | compound-statement: | { ...
2
by: Legendary Pansy | last post by:
Hello, I'm trying to accomplish the impossible by trying to do something equivalent of this example found here http://www.c-sharpcorner.com/Code/2003/Dec/DialogTutorial.as Starting with "Listing...
0
by: richard | last post by:
OS: Winxp and Win2003 Visual Basic.NET 2003 MS-SQL Server 2000 hey all I am a newbie in vb.net but i have managed to build a simple chat server in vb.net using socket and a client connecting...
2
by: Jeff Kish | last post by:
Hi. I'm stuck using a very old c++ compiler, and I'm trying to figure out how to add a declaration so that an algorithm can be used. This is really a compiler specific problem, however I was...
2
by: Joseph Turian | last post by:
I have a class Feature defined, which is a kind of Vocab: template <class T, unsigned I> class Vocab : boost::totally_ordered<Vocab<T,I { public: Vocab(); Vocab(const T& t); template<typename...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.