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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • xxxDNgirl
    New Member
    • Aug 2011
    • 5

    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

    Code:
    #include<stdio.h> 
                                                                
    int a, b, c;                                                                 
    int product (int x, int y);                                                   
                                                                                
    main()                                                                        
    {                                                                            
    //input first number                                                          
    printf("enter a number between 1 and 100: ");                               
    scanf("%d", &a);                                                                                                              
                       
    //input second number                                                         
    printf("enter another number between 1 and 100: ");                           
    scanf("%d", &b);                                                              
                                                                                 
    c = product(a, b);                                                            
                                                                                
    printf ("%d times %d = %d\n", a, b, c);                                   
                                                                                 
    return 0;
    }                                                        
                         
    int product( int x, int y);                                                   
                                                                                  
    {                                                                             
    return (x * y);                                                               
    }
  • alexis4
    New Member
    • Dec 2009
    • 113

    #2
    From line 23 remove the semicolon (;).

    Comment

    • xxxDNgirl
      New Member
      • Aug 2011
      • 5

      #3
      thanks a lot!!!! hehehe ^_^
      success!!!!

      Comment

      Working...