Addition using functions examples in C


This program is about print no return value and without argument using functions.

Source Code Example : 1

#include<stdio.h>
void add();                                               //Function Declaration
int main()
{
  add();                                                  //Function Calling
  return 0;
}
void add()                                                //Function Definition
{
   int a,b,c;
   printf("\nEnter The Two values:");
   scanf("%d%d",&a,&b);
   c=a+b;
   printf("Addition:%d",c);
}
To download raw file Click Here

Output

Enter The Two values:3
4
Addition:7


This program is about print the an example for no return value and with argument using functions.

Source Code Example : 2

#include<stdio.h>
void add(int,int);
int main()
{
   int a,b;
   printf("\nEnter The Two Values:");
   scanf("%d%d",&a,&b);
   add(a,b);
   return 0;
}
void add(int a,int b)
{
   int c;
   c=a+b;
   printf("\nAddition:%d",c);
}
To download raw file Click Here

Output

Enter The Two values:3
4
Addition:7


This program is about example for return type without arguments using functions.

Source Code Example : 3

#include<stdio.h>
int add();
int main()
{
   printf("\nAddition:%d",add());
   return 0;
}
int add()
{
   int a,b,c;
   printf("\nEnter The Two Values:");
   scanf("%d%d",&a,&b);
   c=a+b;
   return c;
}
To download raw file Click Here

Output

Enter The Two values:3
4
Addition:7


This program is about example for return type with arguments using functions.

Source Code Example : 4

#include<stdio.h>
int add(int,int);
int main()
{
   int a,b;
   printf("\nEnter The Two Values:");
   scanf("%d%d",&a,&b);
   printf("\nAddition:%d",add(a,b));
   return 0;
}
int add(int a,int b)
{
   int c;
   c=a+b;
   return c;
}            
To download raw file Click Here

Output

Enter The Two values:3
4
Addition:7


List of Programs


Sample Programs


Switch Case in C


Conditional Operators in C


Goto Statement in C


While Loop Example Programs


Looping Statements in C

For Loop Example Programs


Array Examples in C

One Dimensional Array


Two Dimensional Array in C


String Example Programs in C


Functions Example Programs in C


Learn All in Tamil © Designed & Developed By Tutor Joes