1 Replies - 233 Views - Last Post: 04 November 2017 - 02:27 PM Rate Topic: -----

#1 jadecatunao  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 04-November 17

Multiplication Program

Posted 04 November 2017 - 01:56 PM

#include <stdio.h>

//Function Declarations
int calProduct (int 10,int 5,int 2);
int main ()
{
    // Local Declarations
    int firstTerm = 10;
    int secondTerm = 5;
    int thirdTerm = 2;
    int total;
    
    // Statements
    printf ("Enter units for first term: ");
    scanf  ("%d", &firstTerm);
    
    printf ("Enter units for second term: ");
    scanf  ("%d", &secondTerm);
    
    printf ("Enter units for third term: ");
    scanf  ("%d", &thirdTerm);
    
    total = 10*5*2;
    printf ("\nThe total is: %d\n", total);
    
    return 0;
}   // main



when i try to compile it it says "error: expected ',' or '...' before numeric constant
int calProduct (int 10,int 5,int 2);"

how do i fix this?

Is This A Good Question/Topic? 0
  • +

Replies To: Multiplication Program

#2 sepp2k  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 2511
  • View blog
  • Posts: 3,983
  • Joined: 21-June 11

Re: Multiplication Program

Posted 04 November 2017 - 02:27 PM

You get the error because your function declarations contains numbers in place of parameter names.

Further it seems weird that you declare this function, but never define it or call it. The way it is now, you might just as well remove the declaration altogether.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1