functions1

 //1.with arguments and return value

#include <stdio.h>
int sum(int a,int b); // function declaration
int main()
{
    int a,b,c;
    a=3;
    b=5;
    c=sum(a,b); //function calling
    printf("%d",c);
    return 0;
}
int sum(int a,int b) // function definition
{
    return a+b;
}

Comments

Popular posts from this blog

Tokens in C

Steps taken by a compiler to execute a C program

Variables and Data Types in C