Saturday 8 December 2012

Addition of two numbers in c program with source code.



In this article we are going to learn how to add two number entered by user in c programming language using function.
create function  and initialize that function and call that function by passing parameter you want to add.

#include<stdio.h>
void main()
{
  int a,b;
  clrscr();
  printf("\n Enter 2 Number:"); // user will enter two number one by one
  scanf("%d %d",&a,&b); // number will store in variable a and b.
  printf("\Addition=%d",add(a,b)); //calling  function add
}
  int add(int x,int y)  // in function add passed two parameter x and y.
  {
    return(x+y);  // adding two number
  }
return will  give output.

Share This
Previous Post
Next Post

FYJC XI standard online admisson Process and declaraton of Merit list . Cut off List For prevous year also . 10 Th Results onlne declaraton Maharashtra Region .

0 comments: