create function c

[ad_1]

c functions example
#include 
int addNumbers(int a, int b);         // function prototype

int main()
{
    int n1,n2,sum;

    printf("Enters two numbers: ");
    scanf(

    sum = addNumbers(n1, n2);        // function call
    printf("sum =

    return 0;
}

int addNumbers(int a, int b)         // function definition
{
    int result;
    result = a+b;
    return result;                  // return statement
}
create function c
#include 

// Create a function
void myFunction() {
        printf("I just got executed!\n");
}

int main() {
        myFunction(); // call the function
        return 0;
}

[ad_2]

Please follow and like us:
Content Protection by DMCA.com