what is the error in the below c program-0001?

Ashutosh Teotia
#include<stdio.h>
int areaOfRectangle(int,int);
int perimeter(int,int);
int main()
{
    int l,b;
    scanf(" %d %d",&l,&b);
    printf("%d %d %d %d",l,b,areaOfRectangle(l,b),perimeter(l,b));
    return 0;
}
int areaOfRectangle(int a,int b)
{
    int area;
    area=a*b;
    return area;
}
int perimeter(int c,int d)
{
    int meter;
    meter=2(c+d);
    return meter;
}

why this error:called object is not a function or function pointer at line: meter=2(c+d)?

Also, can I use the same variable a,b to pass in perimeter function?

Lakshitha Wisumperuma

Your code meter=2(c+d);should be changes as meter=2*(c+d); You can use the same variable a,b to pass in perimeter function, A parameter is just a local variable.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related