C Language

June 9, 2023

How 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 : Nadeem Khan

Quick Summary: