C Language

June 9, 2023

How to use function parameters and arguments in C language

program to use function parameters and arguments in C language


#include <stdio.h>
void func(int a,int b);
int main()
{
    int x=10,y=20;
    func(x,y);
    printf("x=%d,y=%d\n",x,y);
    return 0;
}
void func(int a,int b)
{
    a++;
    b--;
    printf("a=%d, b=%d\n",a,b);
}

output


a=11, b=19
x=10,y=20

Tags:

by : Ajaj Khan

Quick Summary:

program to use function parameters and arguments in C language copy #include <stdio.h> void func(int a,int b); int main() { int x=10,y=20; func(x,y); printf(“x=%d,y=%d\n”,x,y); return 0; } void func(int a,int b) { a++; b–; printf(“a=%d, b=%d\n”,a,b); } output a=11, b=19 x=10,y=20